Issue with collission with CharacterBody2D and RigidBody2D

Godot Version

4.2.1

Question

I have a RigidBody2D(item) falling from the top of my screen and when it falls on top of my character, it is captured by _on_body_entered(body): -This is working as expected

If my CharacterBody2D hits the RigidBody2D from its ides(left or right or my CharacterBodt2D) , the collision is not happening as in the _on_body_entered(body) method does not run. Character does not go through the RigidBody2D it does “hit” it and can’t move further but the _on_body_entered(body): is not called on my item.

did you turned on the contact monitor property of the RigidBody2D?

Yes, that one has been enabled and does register the contact when rigidboddy hits the top of my character but if I touch them from their sides, no event is registered.

did you print(body) here and still got nothing when they interacted?

Correct. I’m printing something plus changing animation and changing a state on my character. Nothing happens when hitting on the side.

Looks like I have to add an area node additional to my collision node I created.
Not sure why but this did the trick…
Just make sure to check in the signal if you are entering a body or an area.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.