Stage 2 · Lesson 7 of 7
Debugging games
Game bugs are often visual or about timing, so debug by seeing what happens. Print values to the console. Pause the game on , lines in your code editor where the program stops so you can inspect values.
Draw debug lines, shapes and text in the game view, such as rays, , paths and velocities. Engines help here. has Debug.Log and Debug.DrawRay, has print and a visible collision shapes option, and Unreal has UE_LOG and DrawDebugLine.
Learn to attach the and step through a frame one line at a time. Always make a bug happen reliably before you try to fix it.
Common trapleaving hundreds of log lines printing every frame, which slows the game and buries the one message you need.
A question to check yourself, an AI practice session and 1 cheat sheet entry 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