Search Issue Tracker
Won't Fix
Votes
0
Found in
5.3.4p1
Issue ID
796976
Regression
No
StateMachineBehaviour loses reference after disabling and enabling game object
How to reproduce:
1. Open the attached project
2. Open and Play Main scene
3. Notice debug statement in console "(Clone) (StateMachine)"
4. Disable and enable the gameobject which has the Item script attached to it
5. Observe that the debug log will say null for the State Machine Behaviour
Won't Fix: This is the expected behavior, when you disable a GO with an animator we do flush all instance of AtateMachineBehaviour, it the same for animator's parameter and animator's current state. They are all reset to default value.
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
mahdiii
Dec 02, 2021 18:12
It is not intended really. We need to inject one time not every time the animator enables. We have to inject to all state behaviours again. It is time consuming
Yunis
Aug 21, 2021 13:29
I've got this issue too.
I'm injecting a dependency in a StateMachineBehaviour, instantiated by a AnimatorController.
Later the GameObject is disabled, then later again re-enabled.
shubhamswaraj2021
Aug 22, 2020 11:24
good one <a href="https://www.lyricsauto.com">lyricsauto</a>
funbites
May 16, 2018 18:18
Good question, why is this intended?
LouisHong
Jul 30, 2016 07:03
Why is this intended?