- Home /
Camera jitters while following character controller
I got stuck in this issue for more than weeks , the game does not look smooth it feels like the objects slightly jitter while the camera is moving with the character(I use character controller to move the player). I tried Lerp but it did not work. I change the position of the camera in LateUpdate and make it equal to the players position + offset. I will be waiting for your great solutions :)
Answer by ZoraMikau · Jul 14, 2020 at 09:20 PM
You need to multiply the value you're smoothing the Lerp by Time.deltaTime. Here's a simple CameraFollower script I have. Look at the second line in the FixedUpdate function
using UnityEngine;
public class CameraFollower : MonoBehaviour {
public Transform target; // target to follow (probably the player)
public float smoothing = 5.0f; // how smooth the camera following will be
Vector3 offset;
Camera mainCamera;
void Start(){
offset = transform.position - target.position;
mainCamera = gameObject.GetComponent<Camera>();
}
public Camera GetMainCamera(){
return mainCamera;
}
void FixedUpdate(){
Vector3 newCamPos = target.position + offset;
transform.position = Vector3.Lerp (transform.position, newCamPos, smoothing * Time.deltaTime);
}
}
Yes this is the way I move my camera exactly, but still there is stuttering.
Can you post your code? And maybe even a gif or video of what's happening?
Your answer
![](https://koobas.hobune.stream/wayback/20220613003212im_/https://answers.unity.com/themes/thub/images/avi.jpg)