Skip to content

Commit

Permalink
pantilt recentering was ignoring axis center setting
Browse files Browse the repository at this point in the history
  • Loading branch information
glabute committed Dec 19, 2024
1 parent 5b2d575 commit f955c06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions com.unity.cinemachine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f955c06

Please sign in to comment.