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
- Shader Graph Node information is briefly displayed in Graph Inspector when clicking on Category in the Blackboard
- Module installation fails with "Download failed: Validation Failed" errors when using beta.2 Hub version
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Shader Graph Category dropdown cannot be expanded/collapsed when clicking on the text
- Different text alignment in the column header in Entities "System" window
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.