SubViewport doesn't receive mouse input

Godot Version

4.2.1 Stable Mono


Hello, godot pros!
In my game I have the following node structure on the main scene. I arranged all the components on different viewports so they are easier to manage.
But here’s the issue:
Only the last SubViewpoetContainer in the order gets input from mouse (like hover, clicks etc). The viewports cover each other.

How can accomplish all viewports to get the input? May be via script or with some kind of setting?

Screenshot 2024-02-21 210753

Thanks in advance!

There is the UI paradigm in place, that a mouse click input event is sent only to a single Control node within a viewport.

You can achieve your use-case by utilizing Area2D nodes instead of SubViewportContainer, that act as an interface to SubViewports. You can find an example of how to do that here: SubViewport, InputEvent Pressed and Area3D · Issue #79128 · godotengine/godot · GitHub

Thanks! Even though it seems like an artisanal method, it gets the job done.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.