Aim the pistol up and down using blend trees

Al Heck
2 min readMay 25, 2022

There may not be an animation available, but we’re going to aim up and down by copying animations

In the down and up animations, adjust the right and left arm keyframes setting them to the initial pose and adjust from there — you may need to come back and re-adjust.

Now replace the aiming of the pistol single state to a blend tree and place the aim values inside the blend tree.

Next, let’s get some script to communicate to our float value. In our first person controller, let’s grab the cinemachine camera target x value. Convert this to a float and pass that to the custom control aimingpitch function.

Next, let’s create a function that adjusts the aiming pitch. As the aim amount changes, we will adjust the float value of aim pitch. Now the arm moves up and down as we look up and down.

--

--

Al Heck

Unity Developer and Software Engineer who loves making games with GameDevHQ