Confused about collisions in 3d

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By joeindie

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 get_slide_count() 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!

:bust_in_silhouette: Reply From: kidscancode

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.

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 :slight_smile:

joeindie | 2020-06-06 18:54