Closed PanHoracy closed 7 months ago
Good find! Merged a fix into the main branch.
The issue wasn't related to the dead zone property, but rather the fact that the Framed Follow
PCam
was doing its calculation even when inactive. It didn't make sense as the logic is determined by what the Camera3D
is positioned and aiming at, which, in 99% of cases, will not be the same as the Framed Follow
PCam
— hence why it freaked out.
The change was to essentially disable the dead zone logic until the Framed Follow
PCam
becomes active.
Can find an updated PhantomCamera3D.gd
script if you just want a quick fix:
phantom_camera_3D.gd.zip
One more thing, the reproduction scene has the Camera3D
as a child of a Node3D
that has an offset, which causes the interpolation between the two PCams
to have a sudden jump at first. The quick solve for that is to have the Camera3D
be a child of the scene's root node instead. Will try to address that quirk in a separate commit.
Issue description
I noticed strange behaviour of camera with framed follow mode when that camera doesn't have priority on startup. So I have a setup with start camera, that I then change to gameplay camera. Gameplay camera uses framed follow mode. Here is a visualization of how it should work:
https://github.com/ramokz/phantom-camera/assets/58630927/a9cbaff3-72e1-4cdb-8df3-f790191f329b
And it works like that... if dead zones are somewhere above 0.5. Here the same exact scene, but dead zone has been decreased to 0.2 both in horizontal and vertical
https://github.com/ramokz/phantom-camera/assets/58630927/25ae6492-2fb7-484f-85fa-fad4eb79d502
This problem is not happening, if camera with framed follow mode has priority when game starts. Currently, my walk around is to give gameplay camera priority, than change to start camera at _ready + give start camera tween parameters with 0 duration
I used Godot 4.1.3 during tests.
Steps to reproduce
(Optional) Minimal reproduction project
Change cameras: 1 and 2 (keys)
mininal_reproduce.zip