Area2D not detecting input_event whilst in SubViewport

Godot Version

v4.3

Question

I have set up a scene with a root Node2D that has a SubViewportContainer → SubViewport → Area2D → CollisionShape2D. I have the Area2D signal the root Node2D once an input_event is detected, and this works perfectly until it is placed into the SubViewport where it seems the viewport eats up the input. Once I enable object picking on the SubViewport, the subviewport Area2D recognizes the input sucessfully, however Area2Ds outside of the subviewport no longer recognize the input. Any help on getting Area2Ds both inside and outside of the subviewport to recognize input would be greatly appreciated.

Heres the link to my project if it helps:
https://github.com/pizzaman247/subviewport_area2D_test

Activating physics picking in the SubViewport causes the input events to be set to handled during physics picking in the SubViewport, so that they are no longer sent to other nodes in the root viewport.

If you need to handle input events in multiple viewports, you could set it up like this:

image

and make the following changes:

  • SubViewport:
    • Set Object Picking to ON
  • SubViewport2:
    • Set Object Picking to ON
    • Set Transparent BG to ON

Thanks for the quick response! That definitley worked, and it gave me an idea that I think works better for my cause. The solution I’ve decided to get around having multiple subviewports is to add a script to the subviewport. The script has an _unhandled_input() func which call_defers(“forward_unhandled_input”) which just pushes the unhandled input to the root viewport, and now all area2Ds are able to recieve input. Thanks!