Game Development Reference
In-Depth Information
Let's now place the player in the world just like we did for the platform.
Drag-and-drop
playerSprite_idle_1
into the
Hierarchy
or
Scene
tab,
rename the sprite to
Player
in the
Hierarchy
tab, and change the position to
X: 0, Y: 0
. The player should now be standing on top of the platform as shown
in the following screenshot. If it looks a bit large, no problem—just change the scale
to
X: 0.7, Y: 0.7
and it should look fine.
Let's move it!
With the player sprite in the world, let's set up some animations for it. From the
sprite sheet, you can probably gather that our player has two animations: idle and
walking. If you are at all familiar with Unity's Mecanim system, then this setup will
seem familiar to you. If not, no problem—read along and we shall explain in the
following steps:
1.
Create a new folder in the
Project
tab called
Animations
.
2.
Inside this folder, create another folder called
Player
.
3.
At the top of the screen, navigate to
Window
|
Animation
to open the
Animation
tab. This is where we will actually build the sprite animations.
4.
Select the player object in the
Hierarchy
tab then click on the little red circle
(the record button) in the top-left corner of the
Animation
tab. A
Create New
Animation
window will pop up.