You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When projecting a SubViewport as a texture (i.e. tested with ViewportTexture for Sprite2D and Sprite3D), and the scene inside the SubViewport contains any Control elements, they are not accessible / don't receive any InputEvents.
Explicitly forcing them to get the focus via Control.grab_focus() seems to work, but then any input is just ignored. Tried it with and without SubViewport.handle_input_locally, as well with callback-scripts that reside in nodes inside and outside the SubViewport.
Steps to reproduce
The attached project has two buttons, the "outer" is a child of the main node, while the "inner" is projected as a Sprite2D's texture. The inner button can't be pressed, no matter how I try it.
You can find a rationale for the current behavior in #9950 (comment)
So you have two options:
Use a SubViewportContainer, which automatically sends events to its child SubViewports.
Implement InputEvent-propagation based on your individual requirements from Sprite2D. (In the post above you find a link for how to do this in a 3D-application)
Godot version
v4.1.stable.official [9704596]
System information
Godot v4.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce 940MX (NVIDIA; 31.0.15.1654) - Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 Threads)
Issue description
When projecting a SubViewport as a texture (i.e. tested with ViewportTexture for Sprite2D and Sprite3D), and the scene inside the SubViewport contains any Control elements, they are not accessible / don't receive any InputEvents.
Explicitly forcing them to get the focus via Control.grab_focus() seems to work, but then any input is just ignored. Tried it with and without SubViewport.handle_input_locally, as well with callback-scripts that reside in nodes inside and outside the SubViewport.
Steps to reproduce
The attached project has two buttons, the "outer" is a child of the main node, while the "inner" is projected as a Sprite2D's texture. The inner button can't be pressed, no matter how I try it.
Minimal reproduction project
viewport_test.zip
The text was updated successfully, but these errors were encountered: