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.24k stars 76 forks source link

Phantom Camera 3D gets very laggy when navigating viewport if there is AnimationPlayer Involved. #348

Open yalazur opened 3 months ago

yalazur commented 3 months ago

Issue description

I'm using PhantomCamera3D in a standart setup per documentation, when all is set though, if i try to right click to navigate trough my scene, the Scene become unbearably laggy, however, if switched to other tab and back again, it become buttery smooth, however though, if i select another node, and select PhantomCamera3D Node again, it become laggy again. how this came to be I will explain in steps below:

Steps to reproduce

  1. Open up Scene
  2. Add Camera3D
  3. Add Host to Camera3D
  4. Add Phantom Camera, add another Phantom Camera
  5. Add Animation Player Node (by this point, all is still silky smooth)
  6. Add Animation into the AnimationPlayer node
  7. now everything is unbearably laggy

(Optional) Minimal reproduction project

Reporting Phantom Camera 3d laggy Bug.zip

ramokz commented 3 months ago

Can confirm the performance drop based on your repro steps and sample project.

I'm also seeing performance drop when selecting the Camera3D node, though not the PCamHost node, but it's not as severe as when selecting a PCam3D node.

It doesn't quite make sense for why it would be happening.