From f955c0673e6bb48e04198b638045cce44c8f4eb4 Mon Sep 17 00:00:00 2001 From: Gregory Labute Date: Thu, 19 Dec 2024 14:03:51 -0500 Subject: [PATCH] pantilt recentering was ignoring axis center setting --- com.unity.cinemachine/CHANGELOG.md | 1 + com.unity.cinemachine/Runtime/Components/CinemachinePanTilt.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.cinemachine/CHANGELOG.md b/com.unity.cinemachine/CHANGELOG.md index 26a8e43b6..4bf48d3ee 100644 --- a/com.unity.cinemachine/CHANGELOG.md +++ b/com.unity.cinemachine/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [3.1.3] - 2025-12-31 ### Bugfixes +- Regression fix: CinemachinePanTilt recentering was ignoring axis Center setting. - CameraDeactivated events were not sent consistently when a blend interrupted another blend before completion. - CameraActivated events were not sent consistently when activation was due to timeline blends. diff --git a/com.unity.cinemachine/Runtime/Components/CinemachinePanTilt.cs b/com.unity.cinemachine/Runtime/Components/CinemachinePanTilt.cs index 7ab4ed265..5571b9b26 100644 --- a/com.unity.cinemachine/Runtime/Components/CinemachinePanTilt.cs +++ b/com.unity.cinemachine/Runtime/Components/CinemachinePanTilt.cs @@ -258,7 +258,7 @@ public Vector2 GetRecenterTarget() var v = Quaternion.FromToRotation(Vector3.forward, fwd).eulerAngles; return new Vector2(NormalizeAngle(v.y), NormalizeAngle(v.x)); } - return Vector2.zero; + return new Vector2(PanAxis.Center, TiltAxis.Center); static float NormalizeAngle(float angle) => ((angle + 180) % 360) - 180; }