Inconsistent collision?

Right now I’m trying to implement projectiles into my game, however the system that I used for everything up to this point now just doesnt work, My method is…
-give the object Collision with a collision object
-use some code from the platformer demo provided so solve potential bypasses
image
this is the code used for my projectile

What is not working? The bullet collisions? All collisions in your game?

Have you seen some of the examples?

1 Like

the bullet I showed the code of specifically, its not colliding with the ground

And your groups and masks are correct?

bullet
image

ground
image

Your collision handling won’t ever run, unless

msg_contact_point_response == hash("collision_response")

in which case one of the checks is redundant.

message_id will only ever have one value for a given message and you’re checking if the value is both msg_contact_point_response and hash(“collision_response”) before resolving the collision.

5 Likes

Oh, yeah, there’s nested checks of message_id. That won’t work.

1 Like

This fixed it
My code:
if message_id == hash(“contact_point_response”) then

Local newpos = go.get_position() + message normal *message distance

Go.set position(newpos)
End