Hi, I’m using a custom sidescroller script and am getting extremely choppy camera movement. I know many people have had this issue, and I’ve been trying all kinds of suggestions with no luck. My script:
void Start ()
{
origDist = distance;
}
void Update ()
{
if (target)
{
if (Input.GetKey(KeyCode.LeftControl))
distance = origDist * 5;
else
distance = origDist;
Vector3 targetPos = target.position + Vector3.up * extraHeight;
targetPos.z = -distance;
transform.position -= (transform.position - targetPos) * 0.25f;
}
}
I’ve tried FixedUpdate and LateUpdate as well. How can I get this script to smoothly follow a normal character controller? Thanks!