0 votes

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

in Engine by (12 points)

1 Answer

0 votes

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):
https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html

by (20,485 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 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.