修改摄像机闪现问题

This commit is contained in:
“CongG” 2025-01-03 14:05:50 +08:00
parent 370a33fcd8
commit b603c6a2cf
2 changed files with 6 additions and 0 deletions

View File

@ -74,7 +74,12 @@ namespace KinematicCharacterController.Examples
PlanarDirection = Vector3.forward; PlanarDirection = Vector3.forward;
} }
public void ResetTR(Vector3 rotDefault)
{
_targetVerticalAngle = rotDefault.x;
PlanarDirection = FollowTransform.forward;
}
// Set the transform that the camera will orbit around // Set the transform that the camera will orbit around
public void SetFollowTransform(Transform t) public void SetFollowTransform(Transform t)
{ {

View File

@ -630,6 +630,7 @@ namespace ZXK.LouDiXvMuNiu
kinematic.SetPositionAndRotation(pos, Quaternion.Euler(0, rot.y, 0));///设置相机旋转,位置 kinematic.SetPositionAndRotation(pos, Quaternion.Euler(0, rot.y, 0));///设置相机旋转,位置
characterCamera.transform.rotation = Quaternion.Euler(rot.x, rot.y, 0); characterCamera.transform.rotation = Quaternion.Euler(rot.x, rot.y, 0);
characterCamera.transform.position = characterCamera.pos.transform.position; characterCamera.transform.position = characterCamera.pos.transform.position;
characterCamera.ResetTR(rot);
} }
} }
} }