Animation

Animation

All of the animations for the player character Lily were made in Blender and imported into Unity by me.

Rigging

Following a tutorial from Royal Skies LCC (2020b) who makes very short, compact tutorials, I created an armature to control the player mesh along with Inverse Kinematics handles to make movement more natural and easier to animate (Figure 1).

Figure 1: Player armature in attack pose

Initial Dual Animation Issue

When I first started out by creating my player rig and animating a running cycle, an issue arose from having two separate skeletons, one from the staff weapon and one from the player model. While I could export the meshes as a whole, the animations would export separately for the staff and player, creating two animations, one for the staff and one for the body. This meant I would effectively have to set up two animator controllers and potentially twice the amount of variables to set up.

When looking through Unity forums for a solution I found in Unity documentation (Unity Technologies, 2017) that you can directly read from the source Blender file straight into Unity instead of exporting to FBX. Using this method meant that the animation is taken from the scene as a whole, combining it into one .anim reference in Unity.

As It reads straight from the Blender file, I was able to create and use animations without having to set up the FBX export each time and edit things easily if things needed tweaking.

Running

When creating the running animation (Figure 2) I made use of another tutorial by Royal Skies LLC (2019). I hadn’t planned on how fast I wanted the character to move, so once the animation had been implemented I realised the movement speed and the animation of the feet moving didn’t quite fit together. To try and rectify this I found that you can speed up the animation which allowed me to tweak the running values and animation speed to match them better.

Figure 2 Running cycle in Blender

Attacking Issue

When attacking I noticed that it was quite hard to tell if you had hit or were going to hit an enemy. To try and improve this I added a blast wave (figure 3) to the staff attack animation to show where the edge of the hitbox is.

Figure 3 Attack animation in Blender

Jump, fall and landing

When creating the jumping animation I found a great video: Royal Skies LCC (2020a)  that splits jumping into three parts: the initial jump, falling, and landing. From this I created a separate jump animation (Figure 4) which leads into an idle falling animation and a landing animation which starts from the end of the falling idle. 

To implement the jump I’ve had to use multiple variables to change the animation state. To initiate the jump the script checks whether the player is touching the ground and if they have pressed space, this is then sent to the animator controller which initiates the jump animation. If the full jump animation plays then the animator controller goes straight to the fall idle which loops until the player is grounded again. Once grounded the landing animation plays and returns to the idle pose.

Figure 4 Jumping animation in Blender

Idle animation

For the animator controller the player needs an idle pose that it can go back to when nothing is happening. To do this I animated Lily breathing and moving very slightly while alert, holding her staff (Figure 5).

Figure 5 Idle cycle in Blender

References

Royal Skies LLC (2019) Blender 2.8 animate running in 2 minutes! [Video]. Available online: https://www.youtube.com/watch?v=qxoo_bcUZos [Accessed 07/12/2020].

Royal Skies LCC (2020a). Blender 2.83 : Jumping Animations Tutorial (In 2 Minutes!!!) [Video]. Available online: https://www.youtube.com/watch?v=UEU7EPmpoJA [Accessed 07/12/2020].

Royal Skies LCC (2020b). Blender 2.82 Rigging Tutorial (In 2 Minutes!!!) [Video]. Available online: https://www.youtube.com/watch?v=PFaqjwpGxOc [Accessed 07/12/2020].

Unity Technologies (2017) Importing objects from blender. Available online: https://docs.unity3d.com/560/Documentation/Manual/HOWTO-ImportObjectBlender.html [Accessed 02/04/2021]

Leave a Reply

Your email address will not be published. Required fields are marked *