Cookies   I display ads to cover the expenses. See the privacy policy for more information. You can keep or reject the ads.

Video thumbnail
Hello everyone, welcome to episode three. In the last two videos we’ve covered some of the
fundamentals of programming, such as variables, methods and classes; so today I’d like to
give a quick overview of the Unity interface, so that we can start experimenting with it
in the episodes to follow.
This is the default view when we first open Unity. We can customise the layout,
for example I might drag out this game window so that it sits next the scene view,
and I could do the same with the console window so that it's over here next to the project panel.
And I might also just resize some of these panels because they’re taking up a lot of space.
And then if we want to save our custom layout, we can just go to the layout dropdown on the top right.
And then of course we can switch back to default at any time we want.
All right, so the unity editor is made up of these 6 main panels. The hierarchy, the
scene, the game, the inspector, the project and the console.
The hierarchy shows a list of all the objects that are currently in our scene. So
At the moment I have a camera object and a lightsource. If I were to add in a default cube, that would
show up here, as well as in my scene view, where I can move it around, or by changing to the rotation tool
in the top left, I can rotate it, and scale it. All of these have shortcuts of course:
W to move, E to rotate and R to scale.
In the scene view I can zoom with the mouse wheel, and I can hold down alt + left mouse drag to rotate.
and middle mouse drag to pan.
This little gizmo in the top right, allows us to rapidly switch between viewpoints.
We can also change between perspective and isometric mode, by toggle the cube in the middle.
The game window shows a preview of our game, seen from the eyes of our camera object. We
can press the play button at the top to start and stop the game, though currently not much
will happen as we haven’t programmed anything yet.
The inspector shows us information about the selected object. Remember how in the last
episode I spoke about composition, a way of building functionality out of multiple classes
that each define a single behaviour? Well here we can see an example of this at work.
Our cube object has 4 components attached, all of which are simply classes that Unity
has written, and added to this object to make it into a cube. If I remove the box collider
component, it loses collision functionality; if I remove the meshrenderer component, it
loses rendering functionality. The transform component is what allows us to move the object
around, as well as rotate and scale it.
The project window contains all of the assets for our project. So in a full project we’d
have lots of scripts, and 3d models, audio files and so on listed here. We can drag things
from our project file into our scene. For example, let me add a simple flash class that
I created earlier to the project. If I drag this onto the cube, you can see that it appears
as a new component in the inspector. So our cube now has an additional behaviour. If I
press play, we can see that take effect.
It’s worth getting used to the idea that while we’re in play mode, our changes are
not permanent. I might remove this script, for example, and change the position of the
object, but as soon as I exit play mode, it reverts back to how it was before. This behaviour
is beneficial, however, as it allows to try out new things while the game is running,
without worrying about ruining our work.
Finally, there is the console window. The console allows us to print messages from our
scripts, containing information about, for example, the value of a variable. This allows
us to track down bugs in our code, when things are not behaving as intended. It is also here
that we will receive error messages, if we program something incorrectly.
The last thing I’d like to mention is that we can have multiple scenes. So if I save
this scene, I’ll maybe call it Cube Scene, then I can go create a new scene. In here
I’ll make a sphere object, and then save it and call it Sphere Scene. Now I can switch
between these two scenes by double clicking on them. And obviously there are ways for
us to switch between them using code during our game as well. So as you can imagine, this
is very useful for when we want multiple levels in our game, or even just for separating the
game menu from the game itself.
Ok, so you hopefully now have an understanding of the broad elements of the unity editor.
In the next episode, we’ll start applying everything we’ve learned up to this point
by programming some simple scripts.
Until then, cheers.