-
-
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
When set as "render target", viewport blocks input for children nodes #8419
Comments
This might be sort of by design? Viewports have a method called "input(local_event)" So the simplest way to use it would be
Which should be enough if you only need key/button presses. |
Doesn't work for me, children still don't receive input. |
Oops. I thought I had made it work like that, but you're right, it doesn't. Turns out the way I had gotten it to work was by catching the input in a different node (specifically the ViewportSprite I was displaying the viewport on, if that's important). So you Tried in 2.1.3. Should work. Hope I helped... at all. |
Thanks, it works. But I wonder why it has to be like this. |
It is by design. imagine you draw 2D or an UI over an object in 3D.. it is
up to you on how to send input coordinates to it.
For regular uses (just a sub viewport in 2D), you put the viewport as child
of a Control (or ViewportContainer in 3.0) and eventd are forwarded
automatically.
…On Apr 28, 2017 8:53 AM, "tr0q" ***@***.***> wrote:
Thanks, it works. But I wonder why it has to be like this.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8419 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z2wmAMkQJ7JvT1D6WCslWPNa3hwdSks5r0YzKgaJpZM4M-bZ9>
.
|
I'm revisiting old issues, closing since this is not a bug. |
It has something to do with camera... If the camera is somewere in the level follwing the player... or zoomed at 0.5, the button coordinates inside the viewPort get passed somwere around the topLeft corner |
Godot 2.1.3
(can be quickly tested with the "3d in 2d" demo)
Set up viewport as render target, add child with script that uses _input or _unhandled_input and try print event - nothing will happen. With "render target" disabled this issue won't appear.
The text was updated successfully, but these errors were encountered: