Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FollowMode.THIRD_PERSON _interpolate_position dampens the position of the root point of spring arm rather than the resultant camera position #281

Open
ZenithStar opened this issue May 1, 2024 · 2 comments

Comments

@ZenithStar
Copy link
Contributor

ZenithStar commented May 1, 2024

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:

_interpolate_position(
_get_target_position_offset(),
_follow_spring_arm
)

This is undesirable behavior, for example, in an over-the-shoulder 3rd person camera: image

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

@ramokz
Copy link
Owner

ramokz commented May 8, 2024

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.

@ZenithStar
Copy link
Contributor Author

ZenithStar commented May 8, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants