I have two sprites and I want to detect that is one of them is clicked (setting Material to outline sprite). If a user is miss clicked out or clicked on another sprite the Material sets null for other sprites.
My vision is to create Area2D with nested two Area2D. But when I clicked on nested sprite a _InputEvent called randomly. I assumed that the first call for GlobalArea and next calls for nested Area2Ds.


And a script for each Area2D:
using Godot;
using System;
public class Area : Godot.Area2D
{
public override void _InputEvent(Godot.Object viewport, InputEvent @event, int shapeIdx) {
if(@event.IsPressed()) {
GD.Print("Clicled " + Name);
}
}
}
Thanks!