Let’s Build a Reload Animation with IK

Now that we have a basic idea on how we can go about using IK within Unity to structure our players hands to holding a gun, let’s take a quick look at how we can create a quick reload animation.

First, let’s get to work on building the animation of our character moving the gun up and down:

Next, we will need to add in a few more properties to manipulate within the scene:

With the asset that I am using, it has individual pieces built into the actual object. So, in this case, what we are able to do is give the illusion that we are dropping our empty magazine to the floor:

From here, we are have to adjust our hand animation back to the gun with that of the “new” clip:

After making a few adjustments to the position of the gun, along with the slide to give a more detailed approach of the reload, we can get to something like so:

Now that we have built a new animation from scratch, we just have to create our logic within Unity to know when to play this animation:

Let’s see how this is in our game:

As it stands now, it’s a little bit snappy when we finish our animation, this is because of the transition between animations is set to just 0.75 seconds. Once we adjust the value to have a longer transition period, we can see how it looks:

There we have it. We managed to build in a reload animation from our idle state. With this, I am going to move onto the next little project while looking to maybe create a minigame of some sorts with all of this.

--

--

--

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

Recommended from Medium

CS371p Spring 2022: Santi Dasari

Easily Delete Amazon S3 Buckets

Stack Quiz

testing something real quick adding stuff

What are the best ways to increase productivity as a software engineer?

Principles and Optimization of 5 PostgreSQL Indexes (btree,hash,gin,gist,and brin)

SolRazr Whitelist Application Process

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
Jordan Evans

Jordan Evans

More from Medium

New Input System and UI

Create a Coin Distraction Feature in Unity (Part 2)

A quick guide to player setup in Unity

Cooldown System in Unity