Book Image

Building Levels in Unity

By : Volodymyr Gerasimov
Book Image

Building Levels in Unity

By: Volodymyr Gerasimov

Overview of this book

Table of Contents (17 chapters)
Building Levels in Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
4
Dealing with Basic Animations
Index

Components


All objects in the level are GameObjects: entities that don't do much by themselves but serve as containers for parameters. These parameters are added with the help of components. If you create an empty GameObject via GameObject | Create Empty and look at the Inspector window, you will find that it contains one mandatory component called Transform, which houses properties mandatory for a 3D space (Position, Rotation, Scale). But that is all there is to it; GameObject is just an abstract entity that occupies a location in the Scene. In order to transform it to something more meaningful, more properties, and therefore, more components need to be added.

Adding components

By adding more components, we will add more properties to our GameObjects, so let's do just that and try to reconstruct a primitive:

  1. Create an empty GameObject by going to GameObject | Create Empty in the top menu.

  2. Click Add Component in the Inspector window or Component | Add in the top menu.

  3. Go to Mesh | Mesh Filter...