Hi all,
I have been working in a 3d project that imported Starter Assets - Third Person Character Controller 1.0 (Starter Assets - Third Person Character Controller | URP | Essentials | Unity Asset Store) and everything was working fine up until few days ago when I noticed that the camera is freezing when moving. I did modify the Playground scene a bit, however I rolled back my changes and even created a test scene that uses the same logic to move the camera. No luck. When I create a new project with Character Controller 1.0 everything works fine, however the old project is always freezing when moving the camera.
I uploaded a video of the test scene here 2022 05 23 23 48 10 - YouTube
The script that moves the camera is a slimmed down version of the one that comes with the Character Controller 1.0. I’m wondering if there is some issue/setting at the project level that is causing this
...
private void LateUpdate()
{
CameraRotation();
}
private void CameraRotation()
{
// if there is an input and camera position is not fixed
if (_input.look.sqrMagnitude >= _threshold && !LockCameraPosition)
{
_cinemachineTargetYaw += _input.look.x * Time.deltaTime;
_cinemachineTargetPitch += _input.look.y * Time.deltaTime;
}
// clamp our rotations so our values are limited 360 degrees
_cinemachineTargetYaw = ClampAngle(_cinemachineTargetYaw, float.MinValue, float.MaxValue);
_cinemachineTargetPitch = ClampAngle(_cinemachineTargetPitch, BottomClamp, TopClamp);
// Cinemachine will follow this target
CinemachineCameraTarget.transform.rotation = Quaternion.Euler(_cinemachineTargetPitch + CameraAngleOverride, _cinemachineTargetYaw, 0.0f);
}
private static float ClampAngle(float lfAngle, float lfMin, float lfMax)
{
if (lfAngle < -360f) lfAngle += 360f;
if (lfAngle > 360f) lfAngle -= 360f;
return Mathf.Clamp(lfAngle, lfMin, lfMax);
}
...