Area2d no longer fires input event when ColorRect added to the scene

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

In this basic scene, I’m finding that my Area2d no longer fires the CollisionObject2d.input_event as soon as I add a ColorRect to the scene.

Scene Structure
(Image preview doesnt seem to work - the URL is Imgur: The magic of the Internet )

So there’s:

--> Node2d (root)
----> Area2d
------> CollisionShape2d
------> Sprite
----> ColorRect

I have a script on my ClickableArea2d which is hooked up to the input_event, so that when clicked, it prints to the console.

public void _on_ClickableArea2D_input_event(Viewport viewport, InputEvent inputEvent, Shape shape)
{
    if (inputEvent is InputEventMouseButton mouseButton && mouseButton.Pressed)
    {
        GD.Print("Clicked");
    }
}

If I toggle visibility off on my BackgroundColorRect off, my ClickableArea2d’s input_event fires and the message is logged to the console. However If I toggle visibility of the color rect back on, my clicks are no longer detected.

Can anyone suggest why this is happening, and how I might fix it? I essentially want the BackgroundColorRec as a background only and not to intercept any clicks.


##Edit
After some more searching, I found this helpful SO answer which explains the solution:

In the ColorRect, there is a “Mouse” section. Originally it was set to “stop”. Change it to “Ignore” fixes the issue

:bust_in_silhouette: Reply From: SnapCracklins

Yeah, ColorRect and GUI elements in particular (generally) get placed “on top” of the scene since they’re drawn last (though some SceneTree manipulation helps). Sounds like you solved it though.

If it’s not a GUI screen specifically, turn that Mouse filter off.