From the course: Learning Unity 2D Scripting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Console window

Console window - Unity Tutorial

From the course: Learning Unity 2D Scripting

Start my 1-month free trial

Console window

- [Narrator] Now that we understand how the Inspector works, let's take a look a the console. The console is going to be the first area we usually output messages to when trying to understand what's happening inside of our code. The console also collects any errors in our code, as well as warning messages. Earlier, we had gotten a warning telling us that the field name is hiding an inherited field. If we select the warning, you'll see the full message, below, at the bottom of the console. We'll also see a line number telling us where we can go to fix the code. If we double click on the warning, we'll be taken to the script itself. As you can see, line seven has been highlighted, letting us know that this is the line with the warning. Let's go ahead and add the new keyword after public, save our script and go back into Unity. At the bottom right, you'll see a small wheel that spins, letting us know that the code is being recompiled. By declaring the field as new, letting the compiler…

Contents