In third-person action games, we often need to make a character's upper body rotate to face some location. When a player aims at a target, tracks an enemy, or looks toward a point of interest, the character should be able to orient their torso and look toward that target naturally without moving their feet. The result is a layered sense of physicality. The lower moves according to the character's movement state, while the upper body twists to compensate for any mismatch between the animation and their target's actual position.
A common approach in Unreal Engine is an aim offset blend space. Pre-authored additive animation poses are arranged in 2D where desired pitch and yaw values are used to blend between the various poses. The problem with this approach is that as your base pose changes, the rotation a bone needs to make might change significantly. The authored poses bake in assumptions about the neutral stance of the skeleton. For example, If a character has an offset blend space for a raised rifle, those poses might not apply well to the same character in a relaxed neutral idle, even when the desired twist and pitch in world-space is identical.

My priority for this project was reusability. I wanted a system that could be applied to any character regardless of their proportions or pose. This is where Control Rig really shines. I start by calculating the yaw of the rotation by getting the angle between the character's forward vector and the vector from the character to their target (projected onto the World.Up ground plane so the height difference doesn't add to it). The pitch is calculated the same way, only I use the character's head as the origin rather than their root.
These angles serve as the primary input to the Control Rig, where they are distributed along the spine based on a set of weights. These weights all add up to one so the character’s shoulders end up rotated by the original amount in world space. From here, each bone interpolates its target rotation using its own spring. This lets the tracking ease in and out, while allowing for some overshoot when values change very rapidly. Finally, I calculate a target rotation for the head that will force it to follow the target exactly, making up for angles we limit the spine from reaching.

The biggest upside of this control rig setup is how easy it is to throw on a variety of characters for tracking behavior regardless of state. Additionally, each spine weight and interpolation rate is its own independent parameter, so it gives a much greater degree of control over the target arc of the spine as well as how that arc is interpolated. Without any sort of optimization, the Forward solve takes an average of 27-30 microseconds, so the performance hit isn't too bad either.
There are some things it can't do of course. The biggest benefit blend spaces still have over procedural setups like this is an animator's control over unique poses at each angle. There are some situations where procedural adjustments just aren't going to be enough on their own, but I do think they can be used in many situations with good results.
