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
- 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 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.