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
- [Android] Audio sound is lower in the Player compared to the native music player
- Feet slide and misalign when playing retargeted animations
- IndexOutOfRangeException is thrown in NativePassCompiler when a graphics buffer is used in more than 5 render passes
- "Undo Stack Overflow" error is thrown, and Undo History is deleted when multiselected GameObjects are reparented to their GrandParents
- SearchColumn of type "ObjectReference" does not get refreshed for the custom SearchProvider when lighting generation finishes
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.