Animate characters arms to aim

I want to animate a third person player model such that the weapon he’s holding is aimed to match the mouse movement, but the body of the character stays vertical relative to the ground.
So, the mouse controls the rotation of the character and the elevation of the aim, I’ve got that all scripted ok. I can even draw the aim direction vector with a linerenderer. Now I just need the characters upper body, arms and head to turn to match that aimdirection while everything from the hips down keeps walking normally.

I assume its a blended animation I want, but how do I control the animation to aim along any given angles?

I expect this is a common enough issue, but I cant come up with search terms that will find me an answer. Can anyone point me in the right direction?

Set up a layer for upper body only. This layer’s mask should leave the lower body untouched.

In this layer, create a 2D blend tree with four animations: aiming extreme upper left, upper right, lower left, and lower right.

Then it’s just a bit of math to set the parameters for the blend tree.

Another option is to forgo blended animations and use IK instead. Final IK is a popular choice for this.