Game Dev Cheat Sheet

Unity Scripting Order Reference

Interactive MonoBehaviour lifecycle diagram. Click any callback to see its description and code example.

Understanding when each Unity callback runs is critical for avoiding bugs. Should you initialise references in Awake or Start? Where does camera follow code go? When do physics callbacks fire relative to Update? This interactive diagram shows the complete MonoBehaviour lifecycle with code examples for each event.

Lifecycle Flowchart

Click any phase for code examples.

InitialisationAwake, OnEnableFirst FrameStartPhysicsFixedUpdate, OnCollision/TriggerloopInputOnMouse*, Input pollingGame LogicUpdateCoroutinesyield WaitForSeconds, etc.Late Game LogicLateUpdateRenderingOnWillRenderObject, OnGUIDecommissioningOnDisable, OnDestroy

Execution Order

Initialisation2
First Frame1
Physics3
Input1
Game Logic1
Late Game Logic1
Rendering4
Coroutines4
Decommissioning3

When Does X Run?

Frequently asked questions

When does Awake run vs Start in Unity?
Awake runs once when the script instance is loaded, before any Start. Start runs before the first frame update, only if the script is enabled. Use Awake for self-initialisation and reference-getting; use Start for setup that depends on other objects being initialised.
In what order do Awake calls run across multiple scripts?
Unity does not guarantee order between scripts by default. Use Edit > Project Settings > Script Execution Order to force one script to run before another. Otherwise, do not rely on Awake order; use Start or explicit initialisation calls.
When does FixedUpdate run compared to Update?
FixedUpdate runs at a fixed timestep (default 0.02s, 50Hz), independent of frame rate. Update runs once per frame. FixedUpdate may run zero, one, or multiple times per frame. Use FixedUpdate for physics; use Update for input and visuals.
When does OnEnable run?
OnEnable runs every time the GameObject or component becomes enabled, including on the initial activation after Awake. It runs before Start on the first activation. Use it for state that needs to reset every time the object is reactivated, like subscribing to events.

Last updated: