+1 vote

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

in Engine by (13 points)

1 Answer

+1 vote

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

by (21,718 points)

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

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.

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 Frequently asked questions and 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 [email protected] with your username.