Help with raycasting collision

In my game, the raycasting extension seems to not have collision. May somebody please help!?

@WoofWoof hopefully you can help because I see that you’re really smart with this type of stuff!

Link:

3 Likes

It’s because you are destroying all sprites of kind player, destroying the raycasting engine’s hitbox.

4 Likes

Turns out you can accidentally destroy the player sprite and the only thing that happens is you lose collision!
So basically, using this code I can see that the “myself sprite” in the raycasting extension is just using the default “player” sprite type:


So when you destroy all sprites of kind player later…

It deletes the player sprite too! I suspect the only thing the sprite is used for is collision handling, which is why it doesn’t break the rest of the code when you do this.
The fix here is pretty simple, just change the sprite’s type to be it’s own type that you won’t accidentally delete:

5 Likes

Are you sure you put walls in the tilemap and the myself sprite does not have “ghost through walls” or “ghost” enabled at all?

3 Likes

Wow, I was totally stumped on what went wrong here, thank you for this fix! : - D
There are quite a few other unanswered threads with this same question so I’ll spread the word!

3 Likes

I should probably get back in the habit of reading every help post…

5 Likes

That’s my goal, too! (But for all topics.) I’ve actually watched your posts get approved to a topic while I’m writing mine!
It’s hard though, if you miss even a few days you can be way too far behind to catch them all :laughing:

5 Likes


Every once in a while I go through all of these to find interesting stuff, but I certainly don’t make clearing this list a habit :face_with_diagonal_mouth: I mainly just enjoy cleaning up the help topics, and I avoid a lot of other random stuff. cough the endless stream of new user hosted game jams cough

4 Likes