Search Issue Tracker
By Design
By Design in 2023.1.X
Votes
0
Found in
2020.3.41f1
2021.3.13f1
2022.1.22f1
2022.2.0b14
2023.1.0a18
Issue ID
UUM-18846
Regression
No
Animator Integer state variable gets nulled when playing in builds
Reproduction steps:
1. Open the user’s attached project
2. Build And Run the project
3. In the Player click the “Play“ button and wait for the animation to play
4. When the animation stops point the mouse at an enemy and right-click
Expected result: The Player does not freeze
Actual result: The Player freezes
Reproducible with: 2020.3.41f1, 2021.3.13f1, 2022.1.22f1, 2022.2.0b14, 2023.1.0a18
Reproduced on: Windows 10 Pro
Notes:
1. Not reproducible in the Editor
2. In the Standalone build after shooting the first enemy, bullet collision no longer works and the animation starts to loop
3. In the WebGL build the Player freezes after shooting an enemy and an error pop-up appears
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
- Build fails when building a project containing an 18+ dimension array with IL2CPP
- [Android][Sentis] Human poses are not detected when using the BlazePose model
- Sprite Editor Outline Tool Overlay is not displayed when no Sprite is selected
- “No method with RuntimeInitializeOnLoadMethod attribute” warning from ReadmeEditor.cs is thrown after installing Project Auditor Rules
- Projection matrix is altered when using RasterCommandBuffer.ClearRenderTarget on DX12 and Metal
Resolution Note:
The error in WebGL and the in the standalone build (if you look at the development console, you'll see NullReferenceException being thrown) came from a null Animator that was retrieved from `human.GetComponent<Animator>()`.
Calling `GameObject.Find(hit.collider.name)` is a very unsafe way to retrieve a GameObject. In this case, both the root character game object and the nested mesh game object had the same name. This function would retrieve different game objects in the editor and standalone builds.
If you replace the `GameObject.Find` line with `human = hit.collider.gameObject;`, everything works correctly.
Resolution Note (2023.1.X):
The error in WebGL and the in the standalone build (if you look at the development console, you'll see NullReferenceException being thrown) came from a null Animator that was retrieved from `human.GetComponent<Animator>()`.
Calling `GameObject.Find(hit.collider.name)` is a very unsafe way to retrieve a GameObject. In this case, both the root character game object and the nested mesh game object had the same name. This function would retrieve different game objects in the editor and standalone builds.
If you replace the `GameObject.Find` line with `human = hit.collider.gameObject;`, everything works correctly.