-
Notifications
You must be signed in to change notification settings - Fork 4
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
Global mouse position is messed up when viewport is changed during runtime #1
Comments
When you say changing the size of the viewport do you mean resizing the game window or changing the size property of the viewport in player_viewport.tscn? |
When I resize the game window |
Hmm, it might be related to this issue in Godot: I don't do anything too fancy with split-screen so I think this is probably a problem with using Viewports in Godot. Do any of the solutions in the issue above work for you? |
Does the game manager have a way to get viewport rect size to use for a clamp function, because when I use the built-in get_viewport_rect().size, the character still walks past the boundary on the right and bottom parts of the screen |
You should be able to get the size of the viewport by calling get_viewport().get_visible_rect(). But I can add a method to get you the viewport reference so you can call any viewport methods for each viewport. |
yeah, a method to call viewports would be nice, I had to work around the clamp problem by just changing the size of the player viewport scene to match my project settings. |
Whenever I change the size of the viewport during gameplay, the global mouse position in messed up and the engine cant calculate it correctly, is presume this is because the split-screen functionality of the code doesn't account for viewport changes during runtime.
The text was updated successfully, but these errors were encountered: