Book Image

Learning Unity iOS Game Development

Book Image

Learning Unity iOS Game Development

Overview of this book

Table of Contents (14 chapters)
Learning Unity iOS Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
6
Main Menu, iAds, Leaderboards, Store Purchases, and Achievements
Index

Creating the Character GameObject


Now that we have the major components of the appearance of our character, we need to create it in the game world.

In the Hierarchy tab, on the left-hand side of the Editor window, right-click and select Create New.

This will add an empty GameObject to your scene.

Tip

If you still have the Animator window open, click on the Scene tab at the top of the Editor window.

  1. Make sure that the new empty GameObject is selected. Click on Add Component at the right-hand side of the Editor window in the Inspector tab.

  2. Search for Sprite Renderer and click on Sprite Renderer from the list.

  3. In the Assets/Character folder, select CharacterSheet and click and drag it onto the Sprite section of Sprite Renderer.

  4. You'll see that the sprite gets named as the first child element of the CharacterSheet object: CharacterSheet_0. This is correct and fine.

  5. Next, we need to add an Animator component to GameObject.

  6. In the Inspector window, click on Add Component.

  7. Search for Animator and then click...