0 votes

I am new so I apologize if my questions is silly, but I am confused about detecting collisions between two kinematic bodies.

Everything I read says to use an area instead, but then when I want to move my object, everything I read says to use a kinematic body instead.

I of course tried to use getslidecount() but that only works if my object is moving, if it is stationary it doesn't fire, per the documentation and per my experience.

The problem I am trying to solve is I have an enemy that moves around, and a player that can move around and I want to detect collisions whether either is moving or standing still.

Thanks in advance!

in Engine by (15 points)

1 Answer

+1 vote
Best answer

Kinematic bodies only detect collisions when you move them. If you have two bodies, then either one could be the one that moved and collided with the other.

If the player is sitting still, then the mob moves and collides with the player. If the player is sitting still, then it moves and collides with the mob.

That means that you need code on each object that responds to collision when it moves.

by (20,481 points)
selected by

Yeah, I sorted this out shortly after I posted, but couldn't edit or delete my questions as it hadn't been approved yet but thank you very much for your answer! I solved it exactly the way you explained it so that feels good :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.