0 votes

I have a split screen like setup with multiple viewports on the same screen. I need to handle mouse related input events, most particularly InputEventMouseMotion, but ONLY if the mouse is hovering over the particular viewport. This input may be otherwise unhandled, but I need nothing done unless the mouse is over the viewport the object listening for input is in. How can this be accomplished?

Godot version 3.5.1
in Engine by (93 points)

1 Answer

0 votes

You can just use individual viewports methods for reading inputs and reacting. Get references to them and check Viewport in documentaion. They have their own local input events and even if this won't work for You, You can just get which viewport is being hovered with get_visible_rect

by (8,099 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.