-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewport property "Handle Input Locally" gets set to false for no apparent reason, including in the editor, when it is a child of ViewportContainer. #56502
Comments
(I don't frequently open issues - hopefully I did this right.) |
Oh! And there's an old project I have where this issue doesn't come up... Perhaps because the viewports are added to the container a while after it's set up, rather than being part of the PackedScene? |
Confirmed previous comment - tried it in a separate project and it's DEFINITELY because of the ViewportContainer, not Viewports in general. So it seems... intentional? I would expect a little ⚠ in the SceneTree pane if it's set up in a potentially harmful way, but not forcefully setting the option like that. As far as I can tell, it works fine when set to true... Better than fine, even, because it being set to false results in some very strange behavior, like buttons not being clicked for no apparent reason because something visually behind them is getting the input first. |
I thought I'd mentioned this here, but apparently not... I checked, and it's very clearly intentional. There's a bit of code in ViewportContainer (at least in 3.x) that intentionally disables the option, labelled something along the lines of "don't do this." It appears to have been added in the commit the I'm not sure if it solves #25525. I'm not seeing any absolutely critical issues, and most of the time input goes to exterior elements as you'd expect. However, buttons inside the Viewport still enter the "hovered" state when there's something that should be blocking them, and I had the occasional issue with still clicking "through" an outside element to an inside one - although why the latter happens I can't discern, because I cannot figure out how to reproduce it. I had a couple of elements that were identical in all but position, and one got clicked through outside elements while the other did not. I switched their positions and rearranged them in the hierarchy a few times, and nothing changed, until I detatched the script from both to make sure it wasn't something about my custom input code. When I did that, the outside button always got the click, even when I undid the change - it's broken, detatch, detatch, it works, ctrl-z, ctrl-z, it still works despite the fact it should be in exactly the same state as it was earlier, when it didn't work. |
I just got this issue and spent couple of hours wondering why my viewport input was conflicting outside the viewport container.
|
https://github.com/godotengine/godot/blob/3.5/scene/gui/viewport_container.cpp#L123 Seems to be where the issue is happening. I turn handle_input_locally back on with a script and I just did quick test with gui nodes over the viewport. So far it seems to be just functioning fine? I assume the reason why this is here is because the ViewportContainer handles all the input events by itself and send it to the viewport? The reason why above I'm manually turning it off, since it seems to be taking gui input from nodes that are above it even though it shouldn't be able to do that. So really I guess this just #28833. |
The |
I just ran into this issue of
|
"Handle Input Locally" won't stay checked on 3.4.2-stable. The inspector will show the "revert to default" icon, but even if the property is manually written into the file as being explicitly true, it will always appear as false in the editor when you stop looking at the scene and look back. When running a project, checking it it during the ready function of the viewport's container will return false. Attempting to set it to true during the ready function succeeds, and getting it during the same function call returns true, but it gets reverted at some point between that and the first call of the container's process function, where it will return false. Calling the set function deferred from ready will not be reverted, however, nor will setting it at any point after that... Unless there's some trigger that'll cause it that I simply haven't tripped, like changing the viewport container size or something.
I have no idea why this would happen. Malevolent spirits?
Can be reproduced with the same project as in the below issue.
Originally posted by @SuperSuit12 in #25525 (comment)
The text was updated successfully, but these errors were encountered: