- Edited
I use an area2D for a ball because Kinematic2D mades undesired behaviors for my game. I want to get the entry point of an entered body to manage bouncing. So I try to use the signal body_shape_entered. But I'm totally lost in the API of CollisionObject. And this painfully written attemps give an empty contacts list.
func _on_Ball_body_shape_entered(body_id, body, body_shape, area_shape):
print("body ", body.name)
var enteredShapeOwner = shape_find_owner(body_shape)
var enteredShape = body.shape_owner_get_shape(enteredShapeOwner, body_shape)
var contacts = myShape.collide_and_get_contacts(shape_owner_get_transform(shape_find_owner(area_shape)),
enteredShape, shape_owner_get_transform(enteredShapeOwner))
print(contacts)
When the scene runs the Area2D collides a segment shape, the first "print" shows that, but it seems the arguments of "collide and get contacts" are probably wrong. Thank you in advance for suggestions.