-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Sub - viewports still don't handle _unhandled_input or CollisionObject._input_event() #17326
Comments
CC @Faless PS. @JPTeasdale, can you try following the issue template for this and future bugs? It is hard to guess your version and OS otherwise 😃 Also, it would be nice to have a simple project which reproduces the bug, in order to help hunting it. |
Ahh, sorry about that. I thought since I included the link to the source
where _unhandled_input etc wasn't implemented it would be enough. I'll
hydrate the bug report when I get home.
…On Thu, Mar 8, 2018 at 2:42 AM Bojidar Marinov ***@***.***> wrote:
CC @Faless <https://github.com/faless>
PS. @JPTeasdale <https://github.com/jpteasdale>, can you try following
the issue template for this and future bugs? It is hard to guess your
version and OS otherwise 😃 Also, it would be nice to have a simple
project which reproduces the bug, in order to help hunting it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17326 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQzLzYOcPF7fiiaAqdMKTNrnYvTrL2Nks5tcQUGgaJpZM4Sf8tz>
.
|
Was wondering why input wasn't working on subviewports. Has this fallen off the radar? Is the fix for |
Sadly no, it needs some more work to get object picking to work properly. I tried a fix at some point, but never got it right.
A bit :( |
@Faless Ah I see, keyboard is easy enough to do manually so that's all right. I was just a bit surprised because the doc said ViewportContainer + Viewport handled input automatically. |
As a workaround I've found doing this: extends ViewportContainer
func _unhandled_input(event):
$Viewport.unhandled_input(event) seems to solve the issue (at least for So perhaps the fix can be copy pasted after all? |
@Xrayez, unfortunately your workaround didn't work for me, as I'm trying to use I'm just getting into Godot, and after about 3 months of fiddling around, the ViewportContainer and Viewport nodes are the correct solution to the functionality I'm trying to implement, but this flaw (that |
Yes, I can confirm that the suggested workaround doesn't work for the master branch. I had to move event handling code out of the viewport to mitigate the problem but it'd be nice if we can have a proper fix soon. |
I made it works by copying #15712 and changing it to unhandled_input so that setting the viewport container mouse filter to ignore generate physics picking event with the correct position (which forwading event by the way of the script doesn't). I am sad that it is not the proper fix but it can help peoples desperate like me while waiting for the proper fix. |
I'm curious what the "proper" fix is. I've looked at the code and understood about 20% of how events propagate through the stack, and unfortunately I'm just not familiar enough with the project. Can anyone explain how the problem is supposed to be solved? |
Any news on this or any good way to work around this issue with the Viewports? |
Okay, it seems that I made it work with this in my case:
And then set EDIT Actually if seems that |
From what I have seen it only works when the ViewportContainer is at 0,0
(upper left corner)
…On Thu, Sep 27, 2018, 4:39 PM Cristiano Santos ***@***.***> wrote:
Okay, it seems that I made it work with this in my case:
extends ViewportContainer
func _input(event):
$Viewport.unhandled_input(event)
And then set Disable Input and Object Picking to true on the Viewport
itself
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#17326 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFFXbh6gjmgYVslgbZ_wgiOxwRSBCeRMks5ufWHFgaJpZM4Sf8tz>
.
|
@NightGriffin yes, which is partly the reason why this is not trivial. |
Here's a little improvement to @reyalpsirc's temporary solution to fix the issue @NightGriffin raises, until this is supported by the engine:
|
Looks like the
Note that this is a temporary workaround until a proper fix is implemented in the engine. It works for me, but may not for you. I wouldn't leave it in released code. Although I don't know the full design behind input handling in Godot, it seems weird to call |
It seems unhandled input was simply not being passed. I will add code so it gets passed, you will have to remove your hacks though. |
I"m seeing this issue in 3.1.1 maybe im doing something wrong? |
@EstevanBR I opened a new issue here: #31802 |
@EstevanBR I can confirm it seems to be fixed in 3.2.0a2 available here. |
I still got this issue when using ParallaxBackgrounds. I wanted to use Area2D and mouse enter / exit signals in a Layer in ParallaxBackground and it also won't propagate mouse events correctly |
This is still an issue. I had to use the workaround in #17326 (comment) |
Got caught in godotengine/godot#17326, had to stop using ViewportContainer entirely. Means other hacks (mainly size/positioning in code) but it works
Got caught in godotengine/godot#17326, had to stop using ViewportContainer entirely. Means other hacks (mainly size/positioning in code) but it works
Hi everyone, I'm using Godot 3.4.2 on windows and I need to use this solution from @ArdaE to make it work. |
Adding a solution from this link godotengine/godot#17326
When someone attempts a fix, please also address being able to disable input handling for all nodes inside a viewport.
|
Can someone help create a C# version of the fix in #17326 (comment) ? I need to also be able to check certain variables before passing the input over. EDIT: I ended up figuring it out |
@ashifolfi then please post your fix, as it could help others like you in the future. Thank you. |
I believe there may be a regression for this in at least 4.2.beta5. I'm running into the issue when attempting to drag-and-drop a control into a subviewport. I have downloaded the repro project for the larger parent issue (#57894) and several of the tests are broken in the latest beta. I've looked at the code as well, and it seems like at least the code for this fix is either missing or only partially present, and this bug is part of a larger series of bugs that were previously all fixed at once - I didn't have time to check all of those. |
@WolfgangSenff yes, this is a known issue, reported in #84258 and there is a PR open to fix this issue: #77926 |
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
I noticed in PR #15712 the _input event is forwarded to explicitly created Viewports, but
_unhandled_input
andCollisionObject._input_event()
still don't respondGodot version:
3.0.stable.official
OS/device including version:
OSX 10.13.2 (17C88)
Issue description:
The only input events that propagate into sub-viewports are _input.
_unhandled_event
and_input_event
(for Area2D etc) do not get called.Steps to reproduce:
Open the attached Godot project and run it.
The Red area is in the default Viewport and receives all click events.
The green area is a child of the explicit viewport and only receives
_input
events.Minimal reproduction project:
ViewportInputBug.zip
The text was updated successfully, but these errors were encountered: