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

Object parenting


You can group objects by parenting them to other GameObjects, empty or not. In Unity, it can be done by dragging and dropping the GameObjects on top of each other in the Project or Hierarchy window.

There is one thing to be aware of: it is important to understand that the transformation of the child is no longer relative to the global space, but to its parent object. So whenever the parent object moves, it will move all its children with it. This is also the case for scale and rotation.

Parenting and prefabs

When it comes to prefabs, parenting is quite simple: You freely modify and add any children to the parent object in the Hierarchy view and then hit Apply for them to be saved to the prefab. However, unparenting a child from a GameObject will cause the parent object to lose connection to the prefab.

Note

If you need to use unparenting you will have to lose connection to the prefab for that object, unparent, and then drag and drop it back onto the prefab. That will commit changes...