Stage 2 · Lesson 2 of 7
MonoBehaviour and its lifecycle
A is a script you attach to a (any object in a scene). Unity calls its methods at set moments, known as the . Awake runs when it loads, then OnEnable, then Start just before its first frame.
Update runs every frame, FixedUpdate at the physics rate, and LateUpdate after all the updates. OnDestroy runs at the end. Put each job where it belongs.
Setting up the object itself goes in Awake. Setup that needs other objects goes in Start. Input and per-frame logic go in Update.
Physics forces go in FixedUpdate, and camera follow goes in LateUpdate. Getting this order right removes a whole family of bugs.
Common trapreading another object in Awake before it has set itself up, which gives references that only appear sometimes.
A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CourseFreeUnity Learn: Junior Programmer Pathway
Unity Technologies · Beginner
Unity's official free C# pathway, with small playable projects in every unit
- GuideFreeLearn C#
Microsoft · Beginner
Microsoft's free C# lessons, for the language itself when Unity code feels unfamiliar
Practise
Keep handy
Also worth your time
The exact order Unity calls Awake, Start, Update, FixedUpdate and the rest
- Game Programming PatternsGo deeper
Free book on the state, observer, component and other patterns games rely on