Debugging in Unity P1/3

preview_player
Показать описание
Having problems with your code in Unity? There must be a better way to Debug c# than 𝗗𝗲𝗯𝘂𝗴.𝗟𝗼𝗴 to find and fix it right? 🤔 in this 3 part series of debugging for unity devs I will show you how to use Microsoft Visual Studio Debugger in Unity to debug most common problems like:
-NullReferenceException
-Logical bugs
-calculation bugs

In part 1 we will learn how to use Breakpoints instead of Debug.Log to fixe a NullReferenceException bug.

Lear Object-Oriented programming and how to apply it to Unity projects

Assets used:

If you have any questions ask them in the comments and join the discord :

You can support me through Patreon:

00:00 Introduction
01:00 NullReferenceException bug
02:17 Why not to use Debug.Log
02:56 How to add a Breakpoint
03:30 How to start debugging
04:36 Debugging using DataTips
05:52 Sep Into / Step Over
06:59 How to stop debugging
07:28 Attach and Play
07:56 Dragging Yellow debug arrow
08:08 Using Immediate window when debugging
09:05 Problem with Attach and play debug mode
10:05 OOP for unity devs video course

#debugging #unity #gamedev
Рекомендации по теме
Комментарии
Автор

This is how I debug my code 😉 If you have better / different ways let me know!

SunnyValleyStudio
Автор

I know I already commented on this but I came back to it because, seriously, the moving the Yellow arrow and the Immediate Window is really a game-changer for Unity debugging for me. It is going to prevent the need to recompile and Stop and Restart Play Mode after every one-line code change. That's always been a frustrating process and this just fixes that in most circumstances. Thanks again very much.

beardordie
Автор

Thanks! My breakpoints were being totally ignored. I followed your steps and they work now.

cargorunnerUK
Автор

Great to see a game dev channel cover debugging (in an IDE) properly! I feel like a lot of people should see this who still only use log commands

dreamisover
Автор

I use visual studio's debugging mode like this for a long while now but I didn't know I could move the arrow and I had no idea about immediate window. Thanks! Super useful.

beardordie
Автор

A master class. Thank you very much for sharing it with us!

XaviAndreu
Автор

Great tutorial!! Thanks for making it :D

azrhyga
Автор

Is there any tutorial to make that game? clicking unit and chop tree.

andhikasurya
Автор

Hey Sunny Valley Studio where are your
Civilization like game course ?

rahuldasrd