ramokz / phantom-camera

👻🎥 Control the movement and dynamically tween 2D & 3D cameras. Built for Godot 4. Inspired by Cinemachine.
https://phantom-camera.dev/
MIT License
2.18k stars 72 forks source link

Intial movement of camera when using third person follow mode #166

Closed MartinFretigne closed 9 months ago

MartinFretigne commented 9 months ago

Issue description

The camera initially move when using the third person follow mode when that node is not positioned in (0,0,0).

Steps to reproduce

  1. Use the example "3DFollowThirdPersonExampleScene" from the examples shipped with the addon.
  2. Add 50 to X and Z in the Node3D of the PlayerCharacterBody3D node
  3. Decrease the Damping value from 10 to 1 in the PlayerPhantomCamera3D node
  4. Start the scene and see that the camera is moving directly. Is it wrong to expect it to be positionned directly behind the character, as that's where it's displayed in the editor.

(Optional) Minimal reproduction project

No response

ramokz commented 9 months ago

Good spot! Thanks for reporting this.

Essentially the SpringArm3D node was instantiated during runtime at position (0, 0, 0). So the issue was due to it having to spawn from there and then move to its targeted location. A slow damping + a long target distance away from (0, 0, 0) made that really apparent.

Was just a matter of positioning it correctly when it instantiates.

MartinFretigne commented 9 months ago

Thank you for the fix, its working.