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

PCam3D Look-at behavior doesn't follow target when Follow behavior has dampening enabled. #443

Open
torves opened this issue Jan 2, 2025 · 1 comment

Comments

@torves
Copy link

torves commented Jan 2, 2025

Issue description

When a PhantomCamera3D has both Follow Mode and Look At Mode set, with dampening enabled on Follow Mode, the camera fails to look at a moving target.

This is due to the PhantomCamera3D _interpolate_rotation method using the PCam's position instead of the Godot Camera Node position. The PCam position is not interpolated so it is already in the "final" position the Godot Camera is interpolating towards.

Steps to reproduce

  1. Construct a Node3D scene with a PhantomCamera3D and some 3D primitive object to act as the Follow Target and Look At Target for the PCam.
  2. Set the PCam3D Follow and Look At targets to the primitive object.
  3. Set the PCam3D Follow Parameters to use:
  4. Follow Dampening with values greater than 1 so the effect is more noticeable.
  5. Follow Offset with any reasonable values to view the Follow / Look At target.
  6. Run the scene and move the target object around the scene. You will notice the look at fails to track the target.

(Optional) Minimal reproduction project

No response

@torves
Copy link
Author

torves commented Jan 2, 2025

I've already resolved this issue in a fork commit here.
torves@cda9b0d

This has only been tested using Follow Simple and Look At Simple modes, other modes have not been tested.
If this is satisfactory I can create a pull request for this issue.

Edit:
After testing with other behaviors this will need more work than simply changing it to use the Godot Camera for look at position. This has caused severe stuttering issues I'm still looking into fixing in order to add this tracking behavior.

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

1 participant