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
- Select Preset "None" icon changes after switching tabs
- [Android] Crash when using xxHash3 and targeting the ARMv7 Architecture with IL2CPP Scripting Backend
- GameObject reference in a Script Component becomes missing when unpacking a variant of another Prefab variant
- Project Settings vertical separator position is not synchronized with the mouse position when dragging it horizontally
- Crash on PhysicsDebugDraw::SelectFiltering::Update when entering play mode with Physics Debug window docked and unfocused
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.