Lesson 6
Add Component
Components give a GameObject new powers. Find the Add Component button and use 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 component is
- Find the Add Component button
- Search for a component and add it
What is a component?
A component is a power you give to a GameObject.
| Component | Its power |
|---|---|
| Sprite Renderer | Shows a picture |
| Physics Body | Makes it fall and bump |
| Script | Runs your code |
| Audio Source | Plays a sound |
| Text | Shows words |
Find the button
- Click a GameObject in the Hierarchy.
- In the Inspector, click Add Component.
Choose a component
A window opens. Type in the search box, or look through the groups. Click a component to add it.
The new component shows up in the Inspector, under the Transform.
Some powers need a shape
A Physics Body needs a shape first, like a Box Collider. Add the shape, then the body.
Try this
- Add a Text component to a GameObject. Write your name in it!
- Open Add Component and search for
camera. What do you find?
Try it here
Your mission
Open Add Component and give the sprite a Text.
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!