Creating a First-Person Reload Animation with an Inverse Kinematics Rig in Unity 3D

Dang, my clever subtitle clip is empty…

Today we’re going to be using the IK Rig we built yesterday to create a reload animation. The process is very simple, and if you’ve been reading along and are familiar with Unity’s animation system this should be a breeze.

The first thing we need is to create an empty animation (called “Reload”) and load it into the Animator for our prop. The transition into this animation will rely on a trigger parameter called “Reload.” The transition out will happen naturally with exit time.

With the prop selected, open the Animation window and select the Reload animation.

Then we need to add the position and rotation properties for all of the elements we’ll be animating. The prop object, the magazine clip object, the two hand position objects, and the upper receiver of the prop (mine is called “Top”).

The main object we need to manipulate first is the prop itself. Set the full animation to be about 2 seconds long and then enter Record mode.

In the first frame, move the upper receiver back — when this kind of pistol is out of ammo it won’t automatically return the upper receiver to the forward position until the clip is loaded .

Then select a frame somewhere around the half-second mark and move the weapon up, rotating it to face the player. We want to be able to see the bottom of the weapon where the clip will eject.

Eyyy, remember yesterday when I said we’ll “never” see if the trigger finger is actually on the trigger? Ooops! This is a fix for another time, though.

Now, we don want our left hand in the way of an ejecting magazine, so by this point (still the half-second mark) we also want to move the left hand position out of frame.

Seriously, what is up with those fingers? The animation is not supposed to look like this, lol.

Advancing to 0:40 on the timeline, we’ll select our clip object and drop it out of the weapon.

The clip doesn’t need to be in the left hand (yet), it just worked out that way

Finally, at 1:00 let’s adjust the hand to be cupped under the magazine clip.

From here it is a simple process of copying all the animation frames and repeating them in reverse order on the back half of the animation. The clip and left hand rise back into place, the weapon tilts and moves away from the player back to its original position.

At this point you should have a roughly symmetrical dopesheet.

A few minor adjustments — we want the left hand to return to a slightly different position so it appears to be pushing the clip into place, and we also need to add a bit of “bounce” to the weapon itself to give the sense that the player is slamming that thing in there securely. We also need to return the upper receiver to its proper place. Along with some minor adjustments to the right hand so it stays where it should in relation to the weapon, and we have our final dopesheet:

Let’s take a look at the full animation:

Fantastic. Now all I have to do is fix that finger problem… which probably has to do with the model itself. Otherwise, this looks great.

Tomorrow I’ll have a full project review for the 3D FPS prototype so far.

--

--

--

Unity Developer / Game Developer / Artist / Problem Solver

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Weekly news update #04

Monitoring Syncing of the Server

Test-Driven Development in Android MVVM Architecture (Part 1-Basic Introduction)

[ANNOUNCEMENT] — Announcing New Features on WonderHero Roadmap 2022 Q2

Creating Adding And Authorizing Users and Groups For ssh Connection With Ansible

Installation of CUDA Toolkit on Linux

Failed to get convolution algorithm.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Micha Davis

Micha Davis

Unity Developer / Game Developer / Artist / Problem Solver

More from Medium

Adding enemies to our greybox Prototype

Galaxy Shooter 2D — Blast Wave

Cameras and the Sleeping Guard

Enabling Unity Ads