Get Collision Shape with Area Input Event

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TaufeeqD

I have a 3D object with many Area Nodes with each having a Collision Shape as a child.
When I click in the area and trigger an input_event. How do I get the Collision Shape Node that is the child of the Area node i clicked on, so that I could add a child to it?

:bust_in_silhouette: Reply From: Whom

If the CollisionShape is the only child:


If not:


You could also set a variable for the CollisionShape in your Area script:

onready var collision_shape = $CollisionShape

…and then you could just use area.collision_shape when you need to get the child.