Lesson 4
What is a GameObject?
Everything in your game is a GameObject. Make one, name it, copy it and delete it.
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!
Make a GameObject
- Click GameObject in the menu at the top.
- Click Sprite.
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
| Key | What it does |
|---|---|
| Ctrl + D | Makes a copy |
| Delete | Removes 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,TreeandCoin. - Copy the coin three times.
- Delete one coin.
Try it here
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!