I’m making a 2D game for Android with a camera that only moves up on the Y-axis. I’ve tried everything I know to try to move the camera smoothly, but it still looks jittery when it moves. The game runs at a steady 55-60 fps.
Camera should move up only when the user touches the screen. I currently use Vector3.Lerp to move the camera, but it’s still jittery…
Im not 100% sure on this but i think Vector3.Lerp moves an object gradually between points so if the frame rate changes, so might the movement of the camera. you might want to try using Time.deltaTime. that will move the camera X amount per frame instead of at a set rate
LateUpdate is called after all Update functions have been called. This is useful to order script execution. For example a follow camera should always be implemented in LateUpdate because it tracks objects that might have moved
I just did some more testing and now there’s another problem. I have an object that is moved by its Rigidbody in FixedUpdate and the camera moved in LateUpdate. Whenever the object and camera move at the same time, the camera is smooth but the object is noticeably jittery.
Might be something to do with the peculiarities of FixedUpdate, how it synchronizes with Update and LateUpdate, and how you configure it. I’ll just throw in a couple of links here: