If this rigidbody collides with another is there any way to tell if it is the circle or rectangle that collides? Specifically for a way to get the node, the shape in this instance is just an example.
It depends on what kind of CollisionObject2D those shapes belong to. If it’s also a PhysicsBody2D like the RigidBody2D, then you can connect the body_entered
signal to a function, and it will pass the body that was collided with as a parameter. But if those are Area2Ds, a RigidBody2D can’t detect those. You’d need to use another Area2D to detect them.
In this scenario i was looking for a way to find the specific collision shape assuming the shapes in the image where attatched to a singular body, and body_entered only finds the physicsbody. Although i did find a solution after digging a little deeper into the docs:
1 Like