I am lerping my camera movement like so.
head.transform.localPosition = new Vector3(0f, 0.45f, 0f);
mouseX = Input.GetAxisRaw("Mouse X") * data.sensitivity * Time.deltaTime;
mouseY = Input.GetAxisRaw("Mouse Y") * data.sensitivity * Time.deltaTime;
xSmoother = Mathf.Lerp(xSmoother, mouseX, data.smoothness * Time.deltaTime);
ySmoother = Mathf.Lerp(ySmoother, mouseY, data.smoothness * Time.deltaTime);
yRotation += xSmoother;
xRotation -= ySmoother;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
head.transform.rotation = Quaternion.Euler(xRotation, yRotation, 0f);
To create smoother camera movement but whenever the GC hits it will “spasm” and the camera rotation will wind up way off course.
It doesn’t look like the GC has any OnBefore/OnAfter events where I can turn the smoothing off? Unity - Scripting API: GarbageCollector