My Smoothed out camera is jittery and I realized this, because I testet some nwe generation for my game and funnily enough, because my optimization sucks, my fps have gone down to like 20-30, but there I noticed something: The camera is jittery the worse my FPS are. This is probably because I Update the Position in the Update function, but strangely enough using Fixed Update does not fix it. So I searched for methods to fix the Problem and found this post and tested every method in there, which changed nothing.
If you want to test the movement yourself, I got it from this video. I am somewhat of a perfectionist so this bothers me a lot and I need this fixxed or the game just looks bad.
The solution presented in the commentsection of the video does not work either btw.
The relevant code is here:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraMove : MonoBehaviour
{
public Transform cameraTransform;
public float zoomcount;
public float movementTime;
public Vector3 newPos;
void Update()
{
HandleMovementInput();
}
void HandleMovementInput()
{
//newPos is just the newest calculated position when the camera moves
transform.position = Vector3.Lerp(transform.position, newPos, Time.deltaTime * movementTime);
}
}