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
- Errors are logged when importing an asset at a path with Firebase
- Entering too big of a number in 2D Renderer Lightmode Tags freezes the Editor
- Crash on GUIManager::DoGUIEvent when focusing on the Game view window on a specific project
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
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.