how detect collision KinematicBody 3d?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By flonkopaten
:warning: Old Version Published before Godot 3 was released.

Hello again seems like i must ask about everything i try to learn when it comes to this engine :D.
Well i now got a KinematicBody, meshinstance and a collisionshape (my player)

i got a wall (StaticBody with meshinstance and collisionshape) how make a script to notice that i collide with that wall?

I guess i must write on script that when hit the wall “stop walking” not sure, or is it possible without script?.

Moast important how to detect a collision?

:bust_in_silhouette: Reply From: eons

For kinematic bodies to detect collision you have to move it with move or move_to, move automatically stop the body to prevent overlap and flag the body as colliding.

Look at kinematic character 3D demo for a simple implementation of a kinematic character controller.


And careful if you want to use multiple layers because I think KinematicBody don’t have implemented the masks yet.

Ok Thanks for answer

flonkopaten | 2017-01-10 22:16