Skip to content

Lesson 4

What is a GameObject?

Everything in your game is a GameObject. Make one, name it, copy it and delete it.

10 minDraft

Draft lesson: nobody has followed it from start to finish in the editor yet, so a step may not match what you see.

Video coming soon

We are making a video for this lesson. For now, follow the steps below!

In this lesson you will

  • Know what a GameObject is
  • Make a new GameObject
  • Rename, copy and delete it

Everything is a GameObject

The player, a tree, a coin, the camera... Every thing in your level is a GameObject.

A new project already has two: MainCamera and GameObject. Look in the Hierarchy!

Picture coming soonThe Hierarchy of a new project, with MainCamera and GameObject

Make a GameObject

  1. Click GameObject in the menu at the top.
  2. Click Sprite.

Picture coming soonThe GameObject menu

Your new GameObject shows up in the Hierarchy, and in the middle of the Game panel.

Give it a name

Click it in the Hierarchy and press F2. Type a name, like Player, and press Enter.

Good names help you find things later!

Copy and delete

KeyWhat it does
Ctrl + DMakes a copy
DeleteRemoves it

What makes it do things?

A GameObject alone does nothing. You give it components: a picture, gravity, code... You will learn about them soon.

Try this

  • Make three GameObjects. Name them Player, Tree and Coin.
  • Copy the coin three times.
  • Delete one coin.

Try it here

Coming soon

Your mission

Make a GameObject, name it Player, then copy it.

Soon, a small piece of the editor will be right here, so you can practise without leaving the lesson. For now, try it in the editor!