Unreal Engine 5.8 / Control Rig / Post-Process Anim BP

Body-Avoidance Control Rig

A post-process Control Rig that makes an armored character physically acknowledge the world: they turn, lean and tuck their arms away from whatever is closest. It runs entirely off the incoming pose and a physics probe - no gameplay code, no per-obstacle animation.

Built with
Post-Process Animation Blueprint, layered bone blend, Control Rig
How it senses walls
A sphere around the upper body, plus a short trace to work out which way to move
What it moves
The torso turns and leans, and each arm tucks in

How it works

Three systems

The animation stack

A post-process Anim Blueprint layers a hand-authored sword-on-shoulder pose onto the right-clavicle branch only - the rest of the body passes through motion matching untouched - then runs the avoidance rig on top.

The probe: one sphere, not six spokes

The first build fired six radial probes around the torso and failed in a crowd for a reason worth keeping. The per-side probe results were summed, so two distant NPCs on one side produced a larger reaction than one NPC actually touching the character: the rig was measuring obstacle count, not proximity. An obstacle on each side cancelled to zero and the character walked straight between them.

Replacing those sums with a max made each side report its single deepest penetration, which is what "how close is the nearest thing" actually means. The probe was then rebuilt as one sphere of radius 85 encapsulating the upper body. Two traces rather than one, because the sphere gives direction - the push-out normal from an overlapping sweep - but exposes no penetration depth; a second thin trace fired back along that normal measures the real distance and keeps the reaction graded instead of binary.

The rebuild was deliberately seamed at the two 0-1 side fractions: everything downstream - yaw, lean, arm tuck and four independent smoothing chains - was left untouched, so a detection change could not silently alter the feel of the response.

Arm tuck

Both arms tuck by composing a rotation onto the incoming bone transform rather than replacing it, so the layered sword pose survives. The left mirrors the right by omitting a sign negation, and releases through a peak-hold decay so the arm eases back instead of snapping when an obstacle leaves the bubble.

Tooling & workflow

Authored through script, not the UI

Python remote execution into the running editor's interpreter is the only path that reaches real BlueprintCallable functions rather than poking raw properties, which matters for anything with side effects. Control Rig and Anim Blueprint graphs are authored by script with a layout-and-comment pass, so generated graphs stay readable rather than stacking nodes on one another.

Before deleting anything, a reachability proof: compute the exec-reachable set plus its transitive data ancestors, then assert nothing outside it feeds in. That removed 62 dead nodes from the avoidance rig without touching a live wire. A visual QA loop captures the viewport with camera pose and labeled actors decoded alongside the image and diffs against a reference, and Perforce work is kept in scoped changelists, because a bare submit on binary .uasset work sweeps in everything opened.

Back to portfolio sunsarith96@gmail.com