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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
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}