Unity Assets - Third Person Character Controller camera freezing
Hi all,
I have been working in a 3d project that imported Starter Assets - Third Person Character Controller 1.0 LINK 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 https://www.youtube.com/watch?v=6YCxBr49jI4
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);
}
...
Answer by YOLOnerds · May 24 at 05:04 PM
I believe I might've found the issue. I compared both projects and found that EditorBuildSettings.asset file in the problematic project contained a config object. When I removed it the camera stopped freezing. I tested this on 2 problematic projects and both were fixed when I removed the last line.
NOT FREEZING
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_configObjects: {}
FREEZING
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_configObjects:
com.unity.input.settings: {fileID: 11400000, guid: 9e7be553448fa2546aea5752021cbcf7, type: 2}
Your answer
Follow this Question
Related Questions
how to adjust the camera to make this? 0 Answers
put more than one camera 0 Answers
"Standard Assets" Car Audio Glitchy 0 Answers
Cinemachine crashes unity 1 Answer
Help with third person shooter camera/character rotation (please :)) 0 Answers