How to return true if a collision happens using just CollisionShape? (3D)

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

I have a CollisionShape and I want to return the collision when it collides. How can I simply do that?

:bust_in_silhouette: Reply From: kidscancode

Collision shapes do not collide, they give shape to the colliding objects. You need to use one of the CollisionObject nodes if you want to detect collisions.

See here for details (it’s 2D, but 3D is the same):

Ah okay, so if I am going to use StaticBody, for example, how can i return true if it touches the ground?

LDinos | 2020-03-15 21:57

Static bodies don’t collide because they can’t be moved. Things collide with them. You probably want to use either KinematicBody or RigidBody, depending on what kind of behavior you need. Area if all you need to detect is overlap.

kidscancode | 2020-03-15 22:04