Game Development Reference
In-Depth Information
The hero
Earlier, we imported our hero character's spritesheet into our project and carved up the
sprites from that sheet to ensure they are ready to use. So, let's first just get him or her into
the play area.
As with most things in Unity, there are two ways in which we can do this; first, we'll do
this manually and then show you a shortcut route. The following steps describe the manu-
al procedure:
1. Create an empty game object in our game's hierarchy for our hero (by navigating
to GameObject | Create Empty in the menu) and name it Player .
2. Add a sprite renderer component to the player's game object by navigating to
Add Component | Rendering | Sprite Renderer .
3. Expand the 01 asset in the Sprite folder so that you can see all the sprites in
that spritesheet.
4. Drag the sprite named 01_5 (the idle sprite) to the Sprite parameter of the
sprite renderer on the player's game object.
Note
Be sure to set your transform values for the new game object to 0 or it will create
issues later with the animation. Always define animations with objects set at the
center to avoid confusion; you can always move/place them later.
You should now have the same screen as shown in the following screenshot:
Search WWH ::




Custom Search