phantom-camera
phantom-camera copied to clipboard
FollowMode.THIRD_PERSON `_interpolate_position` dampens the position of the root point of spring arm rather than the resultant camera position
In FollowMode.THIRD_PERSON, _interpolate_position
dampens the position of the anchor point of the spring arm, rather than the resultant end position of the spring arm: https://github.com/ramokz/phantom-camera/blob/a351bfb9c0bfee8e9504d4bb8abe6619de7016d3/addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd#L698-L701
This is undesirable behavior, for example, in an over-the-shoulder 3rd person camera:
Video demo: 2024-05-01 05-43-38.webm
I don't believe there's a quick fix for this without moving dampening logic into PhantomCameraHost: #278
In the video demo, are you using an invisible follow target
rather than the character itself? Since it appears to be rotating around the character, or at least something near it, rather than following something.
follow_target
is the root CharacterBody3D (origin at feet center). A script dynamically sets PhantomCamera3D.follow_offset
as a composite of
_y_offset = _anchor.position.y
where _anchor
is eye-level (where an FPS camera can be hooked up to) and
_xz_offset = offset.rotated(pcam._follow_spring_arm.rotation.y)
where offset
is a Vector2 offset along the world XZ-plane (Vector2( 0.5, 0.0 )
in the video)