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
If the limit node target it set at runtime via the set_limit_node method and the Framed Phantom Camera 2D is not within the bounds of the limit node target then the camera will be stuck in an offset. The issue will stop if the player manages to push the camera into the limit boundary and reach the dead zone.
I ran into this issue when making prefabs for cameras and rooms.
The issue appears to be resolved when commenting out the line below in phantom_camera_2D.gd.
I don't fully understand the impact of this line yet so I didn't make a pr.
Framed_offset_issue.mp4Framed_offest_working.mp4
Steps to reproduce
-Using the 2DLimitExampleScene, remove the Limit Node Target for RoomCentrePhantomCamera2D.
-Take the RoomCentrePhantomCamera2D and move it outside of RoomCentreArea2D's CollisionShape2D.
-Set the RoomCentrePhantomCamera2D's Limit Node Target in the _ready method of 2d_room_limit_tween.gd.
(Optional) Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
RichardStolp
changed the title
Framed camera will be stuck in offset if limit node target is st
Framed camera will be stuck in offset if limit node target is set at runtime
Feb 4, 2024
Getting stuck outside the dead zones where the camera keeps following its target, however and whenever assigned, is a known issue and part of what is intended to be fixed in #161.
The first video is technically the more accurate one, as the second example always keeps the target in the middle of the camera when it's within the dead zone (e.g. at 0:05), which is not the intended result. At 0:08, in the first video, is what ought to happen.
The code you commented out is what detects the position of the target within the viewport. Without it, it will not keep the camera in place as you move around within the dead zone area. So it's definitely needed.
Issue description
If the limit node target it set at runtime via the set_limit_node method and the Framed Phantom Camera 2D is not within the bounds of the limit node target then the camera will be stuck in an offset. The issue will stop if the player manages to push the camera into the limit boundary and reach the dead zone.
I ran into this issue when making prefabs for cameras and rooms.
The issue appears to be resolved when commenting out the line below in phantom_camera_2D.gd.
Properties.viewport_position = (get_follow_target_node().get_global_transform_with_canvas().get_origin() + Properties.follow_target_offset_2D) / get_viewport_rect().size
I don't fully understand the impact of this line yet so I didn't make a pr.
Framed_offset_issue.mp4
Framed_offest_working.mp4
Steps to reproduce
-Using the 2DLimitExampleScene, remove the Limit Node Target for RoomCentrePhantomCamera2D.
-Take the RoomCentrePhantomCamera2D and move it outside of RoomCentreArea2D's CollisionShape2D.
-Set the RoomCentrePhantomCamera2D's Limit Node Target in the _ready method of 2d_room_limit_tween.gd.
(Optional) Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: