Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
1.3.X - Entities
7000.0.0a1
Issue ID
ECSB-1226
Regression
No
The IBaker method "IsActiveAndEnabled(Component)" is returning false on a Prefab Component when the GameObject and the Component are active and enabled
How to reproduce:
1. Open the “ReproActiveAndEnabled“
2. Open the “SampleScene“
3. Observe the Console window
Expected result: “[Worker0] [New Prefab] IsActive(component.gameObject): True vs. IsActiveAndEnabled(component): True” is logged in the Console window
Actual result: “[Worker0] [New Prefab] IsActive(component.gameObject): True vs. IsActiveAndEnabled(component): False” is logged in the Console window
Reproducible with: 1.2.1, 1.2.3 (2022.3.38f1, 6000.0.10f1)
Could not test with: 0.51.1-preview.21 (2021.3.40f1) (Could not resolve the scripting errors)
Reproducible on: macOS 14.5 (Intel), Windows 10 (User’s)
Not reproducible on: No other environments tested
Notes:
- Might need to open the “New Sub Scene“ in the Inspector and Reimport to get the log messages
- Works correctly for GameObjects
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
- UnityYamlMerge.exe doesn't correctly handle merge conflicts in modified properties on a prefab variant
- Inconsistent color scheme in "Details" section of "Select Presets" inspector window
- Crash on __pthread_kill when launching Editor via command-line with "-disableManagedDebugger" argument
- [VFX] Deleting “New Group Node” name doesn’t allow to type or add new name
- [VFX] Creating a long Group Node name breaks nodes boarders
Resolution Note:
The documentation was indeed misleading, Baker.IsActiveAndEnabled checks if the GO is active and the component(behaviour) is active ánd enabled. In the case of a Behaviour, enabled means 'added to MonoBehaviourManager'. Because the MonoBehaviour of a prefab is not added to a manager, as it's monobehaviours are not supposed to run until the prefab is instantiated, it will return as disabled. Note that this is not related to enabling or disabling the MonoBehaviour in editor and also not unique for DOTS; all MonoBehaviours on prefabs will return disabled in every case. I changed the documentation.