Topic was automatically imported from the old Question2Answer platform.
Asked By
Trey Stevens
Im pretty new to godot and im trying to make a game where you need to dodge giant raindrops falling from the sky, my player and raindrops are both kinnematicbody2Ds. I need the player to die if it hits a raindrop and im not sure how to detect the collision, the player is moved using “move_and_slide”
After the “move_and_slide” use “get_slide_count()” to get the number of collisions that occurred, “get_slide_collision()” to get a specific collision then use “.collider” to get the collider:
for i in get_slide_count():
var collision = get_slide_collision(i)
print("Collided with: ", collision.collider.name)