Search Issue Tracker
By Design
Votes
1
Found in [Package]
1.9.4
Issue ID
UVSB-2572
Regression
No
Visual Scripting "OnEnterState" method is called before C# "Awake" when entering Play mode
How to reproduce:
1. Open the attached “IN-86188“ project
2. Open the “Test Scene“
3. Enter Play mode
4. Observe the Console window
Expected result: “C# Awake” message gets printed before “VS Enter!”
Actual result: “VS Enter” is printed first
Reproducible in: 1.9.4 (2021.3.45f1, 2022.3.51f1, 6000.0.24f1, 6000.1.0a1)
Reproducible on: Windows 11
Not reproducible on: No other environment tested
Workaround: Duplicating an entity affected by the bug or rearranging its Components fixes the scripts execution order
Note: Could not test for regression. Unfixable exceptions are spit after downgrading the package.
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
- VFX Graph tooltips have a double line on the bottom side
- TMP font size is "-99" by default when TMP Resources are not loaded
- VFX Graph Node Creation menu can't be navigated using only keyboard
- Universal 3D Sample template build throws RangeError: Array buffer allocation failed when launched on Chrome
- VFX Graph dropdowns are opened in the random place when clicking through them fast
Resolution Note:
This is by design, see https://docs.unity3d.com/Manual/execution-order.html. Quote:
`Awake is only guaranteed to be called before OnEnable in the scope of each individual object. Across multiple objects the order is not deterministic and you can’t rely on one object’s Awake being called before another object’s OnEnable. Any work that depends on Awake having been called for all objects in the scene should be done in Start.`
Thus, here we can't count on CharacterControllerAdapter_Player's Awake to be called before OnEnterState (which is sent from within OnEnable of the StateMachine -- a different object as far as the loading sequence is concerned ).