Game development

Stage 2 of 8 · 7 lessons · ~2 months

Programming for games

Learn C# scripting in Unity: MonoBehaviours and their lifecycle, components and references, C# events, exposed fields, state machines and debugging.

Start: C# for Unity

Lessons· one lesson for each topic, in this order

  1. 1C# for Unity
  2. 2MonoBehaviour and its lifecycle
  3. 3Components talking: references and C# events
  4. 4Small scripts and composition
  5. 5Exposed variables and tuning
  6. 6State machines
  7. 7Debugging games

Do this

  • Finish the first units of your engine's official beginner course.
  • Rebuild the player from your clone with a state machine instead of booleans.
  • Split one large script into at least three small components or child nodes.
  • Add a health component that raises an event and a UI element that listens to it.
  • Expose every tuning value in the editor and tune the jump or movement until it feels right.
  • Fix one bug using a breakpoint and one using debug drawing.
  • Commit after each working change.

Start with· follow one of these

  • CourseFree
    Unity Learn: Junior Programmer Pathway

    Unity Technologies · Beginner

    Unity's official free C# pathway, with small playable projects in every unit

  • GuideFree
    Learn C#

    Microsoft · Beginner

    Microsoft's free C# lessons, for the language itself when Unity code feels unfamiliar

Practise

  • Free mentored exercises in C# and C++ to strengthen the language outside the engine

Keep handy

Also worth your time

Before moving on: A small Unity game written in your own C# scripts: a player with a state machine, an enemy, a health component that raises a C# event, and a UI that listens to it, with all tuning values as [SerializeField] fields.

Tauseef's advice
Follow the official course for your engine, but after every lesson change the project without instructions: add an enemy, a power-up, a second level. The difference between people who can make games and people who can follow tutorials is exactly that moment of building something the video did not show.

Mark this stage as not done?