With access to some nice player character art, we can replace our old capsule character visuals with something a much more exciting.
With this issue, we will integrate in our player character assets to visually represent our character and set up some basic animation to give it some life.
Detail
Building the Character
Fortunately for us, our character artist separated all of the character's limbs into separate files. This is a huge advantage since it will allow us to independently animate our character's limbs in-engine to produce a variety of motions.
To represent our character, we should create a new empty child on the Player GameObject and import each limb as a separate piece in a default pose (with the Torso acting as the root of all the other limbs).
Animation
Once the artwork is imported, we can use Unity's Animation designer to create a couple of animations for the character. Specifically, we'll want the following to start off with:
Default (A 'T-Pose')
Idle
Walk
Falling
The falling animation will player if the player is airborne. Otherwise, if they are moving, they will play the walking animation. Otherwise, they will just idle. Default will be a debug animation.
It's worth noting that you do not need to create an animation for walking in both directions.
Character Animation Script
A new script will be needed to drive our animations. It will need to read the Character Controller (See #35) for horizontal input and grounding status to decide what animation to play.
Tasks
[ ] Import the character assets. Should only need the right-facing, front-lit versions of each limb for now.
[ ] Pull in the new assets to represent the character.
[ ] Create a 'Visuals/Body' Object to hold all each limb.
[ ] Assemble a default "T-Pose" for the character.
[ ] Create animations by transforming the limbs.
[ ] Default
[ ] Idle
[ ] Walk
[ ] Fall
[ ] Use an Animator to make a mapping of the created animations.
[ ] Create a MonoBehavior for handling character animations.
[ ] Relay the horizontal input to the animator.
[ ] Update CharacterController.cs to check grounding status.
[ ] Relay grounding status to the animator.
[ ] Mirror the character if they are moving to the left.
Related Issues
35 - Hard Prerequisite. We will need to clean up the Character Controller class before making a character animation script.
Brief
With access to some nice player character art, we can replace our old capsule character visuals with something a much more exciting.
With this issue, we will integrate in our player character assets to visually represent our character and set up some basic animation to give it some life.
Detail
Building the Character
Fortunately for us, our character artist separated all of the character's limbs into separate files. This is a huge advantage since it will allow us to independently animate our character's limbs in-engine to produce a variety of motions.
To represent our character, we should create a new empty child on the Player GameObject and import each limb as a separate piece in a default pose (with the Torso acting as the root of all the other limbs).
Animation
Once the artwork is imported, we can use Unity's Animation designer to create a couple of animations for the character. Specifically, we'll want the following to start off with:
The falling animation will player if the player is airborne. Otherwise, if they are moving, they will play the walking animation. Otherwise, they will just idle. Default will be a debug animation.
It's worth noting that you do not need to create an animation for walking in both directions.
Character Animation Script
A new script will be needed to drive our animations. It will need to read the Character Controller (See #35) for horizontal input and grounding status to decide what animation to play.
Tasks
CharacterController.cs
to check grounding status.Related Issues
35 - Hard Prerequisite. We will need to clean up the Character Controller class before making a character animation script.