Search Issue Tracker
By Design
Votes
1
Found in
2018.4
2019.3.4f1
2019.4
2020.1
2020.2
Issue ID
1256100
Regression
No
[StateMachine] Reference to StateMachineBehaviour in script is lost after deactivating GameObject with AnimatorController
How to reproduce:
1. Open user attached project "New Unity Project.zip"
2. Open "SampleScene" scene
3. Enter Play Mode
4. Click "Bug me" button
5. Observe Console Window for a few seconds
Expected result: no "Im null!!!!!" message is thrown
Actual result: "Im null!!!!!" message is thrown which means that reference to StateMachineBehaviour is lost
Reproducible with - 2018.4.25f1, 2019.4.5f1, 2020.1.1f1, 2020.2.0a20
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
- [iOS] Application frequently crashes on Social.LoadAchievements call when many achievements are registered
- Errors “RenderPass: Attachment 0 is declared as depth attachment but RGBA8 sRGB is not a valid depth format.“ and “BeginSubPass: Not inside a Renderpass“ are present when using Native RenderPass with a RenderTexture that only has depth output
- ArgumentOutOfRangeException is thrown when an empty DropdownField is clicked at runtime
- [tvOS] "EXC_BAD_ACCESS" error is thrown when Painter2D.ClosePath is called
- Bad Naming Convention in Shortcuts Window for Sprite Shape Editing
Resolution Note:
This is the expected behaviour, when disabling a gameobject we need to free all resources including StateMachineBeahviour in the animator.
you need to retrieve SMB everytime that you deactivate/activate the Gameobject.