HitReactionController
HitReactionController Inspector
HitReactionController
is the per-character hub that receives React()
calls and routes them to the matching BodyPartReactor
. You’ll usually have one controller per rig—placed on the same GameObject that holds the Animator.
Add via: Component ▸ Hit Reactions ▸ Hit Reaction Controller or automatically when you use the Quick-Start prefab helper.
Inspector Reference
1. Animator Settings
Animator
(auto-assigned)
Reference to the character’s Animator
. Left blank? The component grabs GetComponent<Animator>()
at runtime.
Reaction Layer
1
Index of the override layer that carries the additive pose. Must match the layer you created in the Animator Controller (weight is driven automatically).
Tip: Keep the layer type set to Override and weight = 1 in the Animator Controller. The controller sets the weight back to 0 when no hit is active.
2. Body Part Reactors
Drag every BodyPartReactor
on the character into this list once. The order does not matter—lookup is done by name.
Element [ ]
Reference to a BodyPartReactor
.
How It Works
React() is called by a
HitReactionTrigger
(or your own code). Parameters:The controller loops through
reactors[]
; whenpart.name
matchespartName
(case-insensitive) it callspart.React(hitDir, hitPoint)
.Each frame during a hit, the controller copies the reactor’s weight to the configured Animator layer, keeping additive blending in sync.
Because all per-bone math is isolated in the reactor, the controller stays tiny—just a router.
Public API Cheatsheet
Performance:
React()
is O(n) over the reactors list, but n is usually < 10. Call sites are event-based (collisions) so overhead is negligible.
Best Practices
One controller per rig – placing multiples on child props will double-blend the same bones.
Animator Controller setup – dedicate a fresh layer; do not reuse your IK or upper-body layers.
Naming convention – keep bone GameObject names unique per rig (e.g., "Chest", "Chest_1"), or you’ll trigger the wrong reactor.
Pooling bullets? Make sure pooled projectiles reset their
HitReactionTrigger
state so they don’t forward stale collisions.
Next Up
Finish the component set with HitReactionTrigger Inspector, or jump ahead to Recipes & Workflows to see this controller in action across projectiles, swords, and explosions.
Last updated