- Home /
Problem with camera follow script
Hey,
I have a very simple Camera Follow script, following a player running on a platform (with AI running besides him).
Now when the player & AIs all move on the all axes, I have 1 of the following issues, depending on which approach I use:
Directly snapping the camera to the player shows the player smoothly, but the AIs move very jerky, snapping all over the place.
Lerping the camera to the player smooths out all AI movement, but my player will now be shown very jerky.
Some notes:
I am using LateUpdate for my camera follow script
I don't use rigidbodies so it's not related
Camera snapping code:
transform.position = ToFollow.transform.position + CameraDelta;
Camera lerped follow code:
transform.position = Vector3.Lerp(transform.position, ToFollow.transform.position + CameraDelta, Time.deltaTime * 15);
Thanks
I'm curious about this too. There's also a generic 2d camera follow script included in unity that uses a different method but I also noticed jerky movement with that too. I hope you find someone to answer you.
Your answer
Follow this Question
Related Questions
Problem of jerking with the FreeLookCam script of Unity. 1 Answer
Camera follow object after certain point 2 Answers
How to make camera position relative to a specific target. 1 Answer
Adjust Orthographic Camera When Player moves Above half the level height 2 Answers
Why is my camera shaky in editor but not in compiled project? 4 Answers