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
Issue description:
Camera2D drag margins do not appear to respect position/offset when game is running. Strangely, the margins look correct in the editor but they do not correspond to the margins used when the game is running.
Steps to reproduce:
In the linked demo project, the game world has a simple camera looking at a player that can move up/down/left/right. There are blocks showing where the default drag margins are located. When the camera is offset, the drag margins are not respected when the game runs. I have tried using the "Camera2D -> Offset" and the "Camera2D -> Transform -> Position" values but both behave the same. For example:
Change "Camera2D -> Transform -> Position" to (50, 0).
Notice that the drag margins in the editor have updated to show the new offset position.
Run the game and move the player to the left.
Notice that the camera does not respect the new drag margin location since the camera should move almost as soon as the player moves.
I feel this might be a misunderstanding. The Camera2D node does not try to keep its parent node's position inside the drag margins, but its own position. It starts centered when the game is run, so it needs to move at least a drag margin away before it starts moving.
The wanted effect can be accomplished by moving the camera after it manages to initialize itself.
For example something like this might work:
Godot version:
v3.0.4 stable
OS/device including version:
Windows 10
Issue description:
Camera2D drag margins do not appear to respect position/offset when game is running. Strangely, the margins look correct in the editor but they do not correspond to the margins used when the game is running.
This might be related to issue #7489.
Steps to reproduce:
In the linked demo project, the game world has a simple camera looking at a player that can move up/down/left/right. There are blocks showing where the default drag margins are located. When the camera is offset, the drag margins are not respected when the game runs. I have tried using the "Camera2D -> Offset" and the "Camera2D -> Transform -> Position" values but both behave the same. For example:
Minimal reproduction project:
201807131809-camera2d_margin_issue_demo.zip
The text was updated successfully, but these errors were encountered: