From 096df6dd3e074a89ea6256e74342c1b85eb1a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CCongG=E2=80=9D?= Date: Fri, 10 Jan 2025 14:25:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=91=84=E5=83=8F=E6=9C=BA?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=8F=82=E6=95=B0=E8=AE=BE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExampleCharacter/Scripts/ExampleCharacterCamera.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs b/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs index 62e5239..7d17f43 100644 --- a/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs +++ b/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs @@ -76,9 +76,14 @@ namespace KinematicCharacterController.Examples } public void ResetTR(Vector3 rotDefault) { + Transform = this.transform; + + _currentDistance = DefaultDistance; + TargetDistance = _currentDistance; + _targetVerticalAngle = rotDefault.x; - PlanarDirection = FollowTransform.forward; + PlanarDirection = Vector3.forward; } // Set the transform that the camera will orbit around public void SetFollowTransform(Transform t)