Search Issue Tracker
By Design
Votes
0
Found in
2022.3.61f1
6000.0.51f1
6000.1.7f1
6000.2.0b4
Issue ID
UUM-108959
Regression
No
Behaviour.isActiveAndEnabled desyncs when checked from a sibling component during OnEnable/OnDisable
Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Repro.unity“ Scene
3. Enter the Play Mode
4. Observe the Console window
Expected result:
When the GameObject is enabled:
“Secondary OnEnable: enabled=True activeInHierarchy=True isActiveAndEnabled=True (Should be True)” should be displayed
When the GameObject is disabled:
”Secondary OnDisable: enabled=True activeInHierarchy=False isActiveAndEnabled=False (Should be False)” should be displayed
Actual result:
When the GameObject is enabled:
“Secondary OnEnable: enabled=True activeInHierarchy=True isActiveAndEnabled=False (Should be True)” is displayed
When the GameObject is disabled:
”Secondary OnDisable: enabled=True activeInHierarchy=False isActiveAndEnabled=True (Should be False)” is displayed
Reproducible with: 2022.3.61f1, 6000.0.51f1, 6000.1.7f1, 6000.2.0b4
Reproducible on: Windows 11
Not reproducible on: No other environment tested
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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note:
The check is functioning as designed. The unwanted value is returned due to Intermediate script executing before Primary or Secondary object executes OnEnable.
This is documented in our Scripting API:
https://docs.unity3d.com/6000.3/Documentation/ScriptReference/Behaviour-isActiveAndEnabled.html
In order to solve this push back Intermediate script execution in Script Execution Order menu in Project settings.