Hi all,
I am using Cinemachine to follow my spaceship in top-down.
I also added two background layers that follow the camera with different speeds to create a parallax effect
layer.transform.position=Camera.main.position * factor
That led to jittery movement and I figured the reason to be as follows:
- my background layers uses Update to set their positions
- in LateUpdate Cinemachines calculates a new position for the main camera and sets it
- so for that frame the background is not consistent with the actual camera position
I don’t know why this is jittery and not just one frame lagging but I guess the dampening of Cinemachines does not create equal motion every frame.
So my solution was to update the background layers also in LateUpdate and move their script in the script execution order behind Cinemachine so I know at that point my main camera has the correct position for that frame.
Somehow this feels wrong. Changing script order feels more like a last resort (maybe it is in that case). I would somehow need a LateLateUpdate ![]()
Is there any other way to deal with that problem?
Thanks!