I have a collision problem with collisionshape2d

Godot Version

4.4 lastest

Question



How i resolve the problem?

When these two objects collide, they experience an interaction that shouldn’t happen. It’s like the character almost jumps over the circle, or just passes in front of it, and you have to take it up. Or if it’s up and passes over it, the collision isn’t detected.

Could you post a video of this happening?

i can’t, i haven’t permission from the forum (i am new user).

In that case, what are the contents of all the scripts that interact with Barril and Michael?

what you can do to fix it up:

  • is adding StaticBodyShape2D inside of Rigidbody2D with slightly smaller collision shape ( with the same layer as the player )
  • increase collision priority may have impact on how collision is resolved
  • increase damping for Barril in rigidoby component
  • lower velocity for Michael
  • raycasting and applying different velocity
  • mask switching
  • apply collision manually via script so you would have full control with it.

Play with it a little, try out different configurations. My personal winner would be either applying collision manually with apply_central_impulse method for collision blocks and staticshape2d inside rigidbody2d with different layers for rigidobdy and staticshape2d