0 votes

how can Area 2D detects a CollisionShape2D

in Engine by (104 points)

1 Answer

+1 vote
Best answer

You don't detect shapes, you detect collision objects. CollisionShape2D gives a shape to a CollisionObject2D.

Area2D can detect overlap with other areas, and it can detect PhysicsBody2D objects, which are RigidBody2D, StaticBody2D, and KinematicBody2D.

See Physics Introduction in the docs for a complete explanation.

Unless you mean when an object has multiple shapes assigned. In that case, you can use body_shape_entered or area_shape_entered to see which one it was on the colliding object.

by (20,671 points)
selected by
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.