Search Issue Tracker
By Design
Votes
1
Found in
2020.3.45f1
2021.3.19f1
2022.2.7f1
2023.1.0b5
2023.2.0a3
Issue ID
UUM-27271
Regression
No
Wrong rotations are set when using “SetLocalRotation“ in animation
How to reproduce:
1. Open the user’s attached “Animation Job Sets Wrong Rotation.zip” project
2. Enter Play Mode
3. In the Hierarchy window select “LeftArm” GameObject and observe its rotation
Expected result: Rotation is (10, 20, 30)
Actual result: Rotation is (10.612, 20.361, 30.065)
Reproducible with: 2020.3.45f1, 2021.3.19f1, 2022.2.7f1, 2023.1.0b5, 2023.2.0a3
Reproduced on:
macOS 12.4 (Intel)
Windows 10 (user’s info)
Notes:
Also reproducible with other bones too. Select “DefaultHumanoid” GameObject and observe other bones' rotation.
Reproduced in the Editor and in the 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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
The results of this scene are to be expected. The imprecisions are also expected when using the Humanoid solve, as the Humanoid works in Muscle space values and conversion is required. Humanoid is not a lossless process and should only be used if retargeting is required. In order to avoid the these problematics completely, we recommend using the Generic Animation Type instead. The Generic type will give you the exact result you where expecting in this scene.
If you require Humanoid for retargeting purposes, here's an explanation of the results you are seeing. First, what you are basically doing is, playing a Humanoid Muscle clip, locking Euler values on some bones, and applying IK on the feet (default Humanoid behaviour). When using a Humanoid solve, Euler curves go through a conversion to Quaternions in Muscle space. When these values are converted back into transform values, they have the same visual orientation, but values may change and we cannot guarantee these values will be the same. Other Humanoid solve rules such as limits may also change these values. In this case, you are also applying IK to the feet (default Humanoid behaviour) after the clip and the set rotation, explaining why the foot still follows the IK goal and moves the leg (with the static value now moving to the IK). If you want to set the bone rotation in the Humanoid context, we recommend setting the Muscle values in Humanoid directly. This will avoid extra conversion and imprecision . You should still not expect exact values as the Humanoid solve will do a final conversion to transforms and this will not be lossless.