Overview

This tutorial covers the fundamentals about the GameObject entity and the Component entity. You will be introduced to both Unity’s entities and how to work with them.


Deep-diving & How To…?

In Unity, you will work a lot with an entity called GameObject, witch is composed by Components.

GameObjects

A GameObject is a Unity entity that composes Scenes. Any new object created in a Scene is held by or is in part a GameObject.

Check on the GameObjects already existing in the SampleScene. There’s a GameObject named Main Camera in the Hierarchy window.

image.png

If you click on it and take a look to the Inspector window, the selected GameObject’s components will be displayed.

Each element listed in the window (Transform, Camera) is a Component.

image.png

image.png

<aside> 💡

You can fold and unfold components by clicking on the top-left arrow in their header.

image.png

</aside>

<aside> 💡

By definition, all the GameObject are composed by at least one component: the Transform component.

</aside>

You can create new GameObjects by simply right-clicking in the Hierarchy window; or using the GameObject menu at the top left of the Editor window.

Right-clicking on the Hierarchy window will display this menu.

Right-clicking on the Hierarchy window will display this menu.

Selecting the GameObject menu in the toolbar on top will display a similar menu.

Selecting the GameObject menu in the toolbar on top will display a similar menu.

After that you can type in a name for the GameObject.

image.png

You have succesfully created an Empty GameObject.