Detecting Collisions between two KinematicBody

AwbbieAwbbie Posts: 2Member

Hello, I am a teacher making tutorials for my students. We have been using the Godot 2D Platformer to teach about 2D level design; how to use tile maps and such. How can we make it so that the enemies actually do something on collision with the player? Even just being directed to a tutorial would be great. Thanks!

Tagged:

Tags :

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 1,000Admin
    Answer ✓

    Unfortunately, you cannot respond to collision between two KinematicBody nodes.

    You can use a Area2D or Raycast2D node for figuring out what each KinematicBody collided with and then respond accordingly. Another potential thing to try is using two RigidBody2D nodes in Kinematic mode and then using contract reporting. Personally, I would just suggest using a Area/Raycast2D node, as it is WAY easier.

    If you have not read it already, you can find out more about how Godot handles collisions in the Physics Introduction section of the Godot documentation.

    Hopefully this helps! :smile:

  • AwbbieAwbbie Posts: 2Member

    Thank you!

Sign In or Register to comment.