You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a copy of #30215, as it seems it was incorrectly closed (or there's a regression).
When I use the get_global_mouse_position() in a normal scene, the coordinates are right, but when I use in a scene that uses a viewport container to render pixelated the scene, the coordinates are incorrect.
Steps to reproduce
Add a viewport node with a non-1:1 scale. Note that get_global_mouse_position returns the wrong coordinates.
In your MRP, it is correct, that to_local has no effect in this case, because TileMap has a default transform. to_local is not affected by the viewport.
The SubViewport-setup in your MRP looks complicated. Doesn't look like a trivial issue to investigate.
Currently the method that brings you as close as possible to your wanted functionality is to set in your MRP SubViewportContainer.stretch_shrink = 4
This will automatically scale the SubViewport to the size of 1/4 of the SubViewportContainer.
Thanks, I'll mess around and see if that fixes the mouse coordinates. This particular project was created in version 3.something then migrated to 4 which might explain how it got into such a weird state.
Godot version
4.0rc1
System information
Linux
Issue description
This is a copy of #30215, as it seems it was incorrectly closed (or there's a regression).
When I use the get_global_mouse_position() in a normal scene, the coordinates are right, but when I use in a scene that uses a viewport container to render pixelated the scene, the coordinates are incorrect.
Steps to reproduce
Add a viewport node with a non-1:1 scale. Note that
get_global_mouse_position
returns the wrong coordinates.Minimal reproduction project
scale-bug-4rc1.zip
The text was updated successfully, but these errors were encountered: