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
- Shader warnings are thrown after building High Definition 3D template
- "EndLayoutGroup: BeginLayoutGroup must be called first" error is thrown when changing Shader Precision Model from the Build Profiles window
- White artifacts/outlines are visible in the Garden Scene when viewing at meshes from a distance
- Shader warnings "Sprite-Unlit-Default" are thrown after building 2D Platrformer Microgame Template
- [Android] HLSL shader becomes corrupted when running on an Android device
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.