![]() Thus, when a RigidBody2D (which is handled by physics) hits the KinematicBody2D, you probably want to handle that on the RigidBody2D.Īnother advantage of placing the collision response logic on the objects that the player avatar can collide with, is that the player avatar code is not aware of them. However, note those are meant to handle collisions are result of the motion of the KinematicBody2D. I also mentioned that you can handle collision in your KinematicBody2D, that would be with move_and_collide or get_slide_collision. Well, RigidBody2D also has a "body_entered" signal that you can use for that. That leaves the question of how to handle the rock ( RigidBody2D) collision with the player avatar ( KinematicBody2D). That is, the trap ( Area2D) would detect the player avatar ( KinematicBody2D) and act on it. The icon of KinematicBody2D should be a clue.
0 Comments
Leave a Reply. |