Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2021.3.29f1
2022.3.7f1
2023.1.8f1
2023.2.0b4
Issue ID
UUM-45915
Regression
No
GameObjects Y axis always gradually aligns with the world space X, Y, or Z axis when manually calculating rotation using the "Animator.angularVelocity" property
Reproduction steps:
1. Open project “Repro.zip”
2. Open scene “Sample”
3. Enter Play Mode
4. Observe the characters through the Game view
Expected result: The characters always remain in the same position and rotation
Actual result: The characters gradually align with the world space X, Y, or Z axis (“player_animctrl_manual” and “player_animctrl_builtinthenmanual” GameObjects in the Hierarchy)
Reproducible with: 2021.3.29f1, 2022.3.7f1, 2023.1.8f1, 2023.2.0b4
Reproducible on: macOS Ventura 13.2.1 (Intel), Windows 10 (by the reporter)
Not reproducible on: No other environment tested
Notes:
- Also reproducible in Standalone Player
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Look Dev constantly regenerates the default Volume Profile when set to "None" instead of using the default one
- Look Dev errors are spammed when opening a new HDRP project when Look Dev was added to the layout in the previous project
- URP Scene Templates are not editable when first opened from the New Scene dialog
- Look Dev window flickers when resizing the window after docking it
- UI breaks when Multiplayer Center window section divider is moved too far
Resolution Note:
The issue doesn't come from Animator.angularVelocity but from calling the wrong function in the user code :
{code:c#}
var rotationAngle = _animator.angularVelocity * Mathf.Rad2Deg * deltaTime;
transform.Rotate(rotationAngle, Space.World);
{code}
This version of transform.Rotate() takes euler angles as parameters and not an axis and an angle. The user can fix the issue by using the appropriate function that takes an axis and an angle instead :
{code:c#}
var deltaTime = Time.deltaTime / Time.timeScale; // Time.unscaledDeltaTime is not always accurate
var rotationAngle = _animator.angularVelocity * Mathf.Rad2Deg * deltaTime;
transform.Rotate(rotationAngle.normalized, rotationAngle.magnitude, Space.World);
{code}
Resolution Note (2023.2.X):
The issue doesn't come from Animator.angularVelocity but from calling the wrong function in the user code :
{code:c#}
var rotationAngle = _animator.angularVelocity * Mathf.Rad2Deg * deltaTime;
transform.Rotate(rotationAngle, Space.World);
{code}
This version of transform.Rotate() takes euler angles as parameters and not an axis and an angle. The user can fix the issue by using the appropriate function that takes an axis and an angle instead :
{code:c#}
var deltaTime = Time.deltaTime / Time.timeScale; // Time.unscaledDeltaTime is not always accurate
var rotationAngle = _animator.angularVelocity * Mathf.Rad2Deg * deltaTime;
transform.Rotate(rotationAngle.normalized, rotationAngle.magnitude, Space.World);
{code}