menu_bookDocumentation
Component Execution Order: Lifecycle Flow and GameObjectSystem Ordering
s&box component execution order determines when lifecycle methods are called. You should not rely on the order in which the same callback gets invoked for different GameObjects — it is not predictable. Use a GameObjectSystem for controlled ordering.
Execution Flow
The scene processes components in this order each frame:
- OnLoad (async) — during scene loading, loading screen stays open
- OnAwake — once after deserialization, if parent is enabled
- OnStart — first time component is enabled, before first OnFixedUpdate
- OnEnabled — each time component becomes enabled
- OnFixedUpdate — every fixed timestep (physics tick)
- OnUpdate — every frame
- OnPreRender — every frame before rendering (not on dedicated servers)
- OnDisabled — when component becomes disabled
- OnDestroy — when component is destroyed
Was this helpful?