![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ManiCus |
how can Area 2D detects a CollisionShape2D
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ManiCus |
how can Area 2D detects a CollisionShape2D
![]() |
Reply From: | kidscancode |
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.