Search Issue Tracker
By Design
Votes
2
Found in
2020.2.2f1
2020.2.4f1
2020.3
2021.1
2021.2
Issue ID
1324131
Regression
Yes
"Animator.GetBoneTransform" doesn't get bone's transform from prefab
Reproduction steps:
1. Open attached project "Dellt.zip" and scene "Addon"
2. Enter Play Mode
3. Observe Console window
Expected result: No errors
Actual result: "NullReferenceException: Object reference not set to an instance of an object MecanimToRagdoll.GetBone" error
Reproducible with: 2020.2.2f1, 2020.3.5f1, 2021.1.4f1, 2021.2.0a14
Not reproducible with: 2019.4.24f1, 2020.2.1f1
Could not test with: 2018.4.34f1 (compilation errors break project)
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note:
GetBoneTransform requires an active animator to return the correct transform.
Prefabs don't have active animators until they are instantiated.
The best way to fix the sample in this case would be to instantiate the prefabs in the Start method, cache the poses from the prefabs for later use, and remove the instantiated prefabs.