How do I connect some Area2Ds to the main scene?

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

Hi all, a little confused/curious about a little something I’d like to get working.

I’ve got a scene{Node called “TouchAreas”} with three Area2Ds, each with their own CollisionShape2D. This scene is being instanced in the main scene. I have a turret that rotates on input, and would like for the player to be able to turn it when they click in the respective Area2Ds {“UpArea” and “DownArea”}.

I’m trying to understand what you exactly want. So when the player clicks on the Area2Ds, the turret will turn? When they click on “UpArea”, the turret turns upward? You want the player’s input to affect the turret in this fashion? Is this correct?

If that’s the case, you can use a signal to connect the Area2D to the turret’s node.

Btw, how is this question different from the question you asked yesterday? If this is a continuation of that question, then please restrict it to that thread.

Ertain | 2018-12-19 19:24

I’m afraid I couldn’t understand the answer, and wasn’t sure how to add it to my code.

System_Error | 2018-12-19 19:50

Ask rojekabc (the one who answered your question) to clarify their response.

Ertain | 2018-12-20 01:59