When to use Area2D? (Or better question: Is this a good usage of Area2d?)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Qws
:warning: Old Version Published before Godot 3 was released.

At this moment I’ve a character scene that is a KinematicBody2D, which contains no direct sprite node. But it does have an instance of an external Area2D child node which contains also a sprite child node. So indirectly the KinematicBody2D has an Area2D node + Sprite Node.

Because I want to use the “Enter_Body” event whenever 2 sprite nodes are colliding.

Is this good usage of Area2D?

:bust_in_silhouette: Reply From: Footurist

Why this complicated structure? Why not just this:

PhysicsBody2D / Area2D

CollisionShape2D
Sprite

Set up to of these and then connect the signal body_entered to the node where you want to call the function. The same works with 2 PhysicsBody2Ds aswell.
Area2D is best used as a field, which detects collision, but won’t physically interact.

Only area2D emits the signal “body entered” so the structure you offer does not work without area2D.

SynthED | 2020-12-29 19:36