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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
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.