Springs on an Animated Character: Secondary Motion with the Animator
The Animator writes every bone it animates on every frame, after your scripts’ Update, so a spring that moves one of those bones is overwritten before anything is drawn. Put the spring on something the Animator doesn’t touch: an empty parent above the object with the Animator, for hits and knockback that move the whole body, or an empty child under a bone, at the point a prop such as a backpack hangs from. The animation and the spring then add up, which is the simplest kind of procedural animation you can layer on a character.

Why the Animator overrides your spring
Section titled “Why the Animator overrides your spring”Each frame, Unity runs every script’s Update, then evaluates the Animators, then runs LateUpdate. That is the order with the Animator’s Update Mode on Normal, the default. A spring that writes a bone’s rotation in Update has its result replaced a moment later by the pose from the animation clip. The spring keeps running, but you never see it.
Which bones count as animated depends on the rig. On a Humanoid rig, the Animator writes every bone mapped in the Avatar, every frame; extra bones such as hair or a tail are left alone unless a clip animates them. On a Generic rig, it writes every property that any clip in its controller animates.

Writing the bone in LateUpdate instead does win, because it runs after the Animator, but then the spring replaces the animation on that bone rather than adding to it. Unless you write your spring to start from the pose the Animator just wrote, the bone loses its animation.
Where the spring goes
Section titled “Where the spring goes”Two places, and both work with any spring, hand written or not.
On a parent. Add an empty GameObject between the character’s root, the one your movement code moves, and the object with the Animator. The Animator only writes the bones below it, so a spring that moves, tilts or squashes the empty moves the whole animated character on top of its animation. This is the place for reactions of the whole body: hits, knockback, landing squash. Don’t put the empty between the Animator and its bones: the Animator finds bones by their path below it, and a new object in that path breaks the animation.
On an empty child. Add an empty GameObject under a bone, at the point a prop hangs from, and move the prop under it. The spring turns the prop around the empty, so the empty is the pivot: a backpack’s goes at its straps, a plume’s at its base, an antenna’s where it meets the head. Placed at the prop’s centre instead, the prop slides off the body as it turns. The bone carries the empty along with the animation, and a Local Space spring on the empty rests there and swings when you nudge it, for example from the same hit that tips the body. For parts that should swing by themselves whenever the character moves, see Spring Bones below.
Character ← your movement, CharacterController, KnockbackMover, Knockback└─ Hit Spring ← spring on the parent └─ Model ← Animator └─ Rig └─ ... chest └─ Backpack Spring ← spring on an empty child, at the straps └─ BackpackWhat to animate and what to spring: keep the authored motion, such as the walk, the attack and the idle, in the Animator, and spring the reactions to what happens in the game and the parts that dangle. A hit can come from any direction at any moment of any clip, which a spring answers and a keyframed reaction can’t.
Knockback on an animated character
Section titled “Knockback on an animated character”Knockback has two parts, and they go in different places. The push is gameplay: it moves the character’s root, through the same CharacterController or Rigidbody your movement uses. The reaction is visual: the body tips back and recovers, on the spring parent. The Animator keeps playing locomotion through both, because neither touches the object it animates.
With a CharacterController, keep a knockback velocity that fades away, and move by it every frame alongside your normal movement:
using UnityEngine;
// The springs with an Animator guide's knockback by hand: the page shows this file as it ispublic class KnockbackMover : MonoBehaviour{ [SerializeField] private CharacterController controller; // How fast the push dies away: higher stops sooner [SerializeField] private float recovery = 6f;
private Vector3 knockback;
public void Push(Vector3 velocity) => knockback += velocity;
private void Update() { controller.Move(knockback * Time.deltaTime); // Fades out the same way at any frame rate knockback *= Mathf.Exp(-recovery * Time.deltaTime); }}Call Push with the hit’s direction times its strength. Recovery sets how fast it dies away: the character slides about the push’s speed divided by Recovery before stopping. If your movement code already calls Move once a frame, add knockback to the velocity it moves by instead of calling Move twice.
With a Rigidbody, AddForce(direction * strength, ForceMode.VelocityChange) gives the same push, and the body’s Linear Damping (Drag in Unity 2022.3) slows it. If your movement code sets the Rigidbody’s velocity every FixedUpdate, it erases the push the next step: add the knockback to the velocity you set instead.
The reaction, on the parent spring, is a spring kicked in the direction of the hit. With All In 1 Springs Toolkit it is a few lines:
using AllIn1Assets.AllIn1SpringsToolkit;using UnityEngine;
// The springs with an Animator guide's hit reaction: the page shows this file as it ispublic class Knockback : MonoBehaviour{ // A TransformSpringComponent on an empty object between the character's root and the object with the Animator, // with its Follower set to that empty object, in Local Space [SerializeField] private TransformSpringComponent spring; [SerializeField] private float push = 2f; [SerializeField] private float tilt = 3.5f;
// Call it with the direction the hit travels in public void Hit(Vector3 direction) { Vector3 local = transform.InverseTransformDirection(direction); local.y = 0f; local.Normalize(); spring.AddVelocityPosition(local * push); // Tips the model over in the direction of the hit spring.AddVelocityRotation(Vector3.Cross(Vector3.up, local) * tilt); }}
If the Animator applies root motion, it moves the object it is on by the clip’s motion. In that case your character script usually takes that motion in OnAnimatorMove and passes it to the CharacterController; add the knockback there.
With All In 1 Springs Toolkit
Section titled “With All In 1 Springs Toolkit”Don’t own it yet? → Get it on the Unity Asset Store
Transform Spring Component on a parent or an empty child. Add the component to the empty, set its Follower to the empty itself and Space Type to Local Space, and enable the springs you want: Position and Rotation for a hit, Rotation alone for a backpack. In Local Space the spring rests at the empty’s own local position and rotation, so it sits still until you nudge it with AddVelocityPosition or AddVelocityRotation, as Knockback does, and settles back there. The component writes its follower in Update, so on a bone the Animator animates it would be overwritten exactly as above. Basic Usage and Transform Spring Component Breakdown cover the settings.
Keyframing the Target. To mix an animation with a spring instead of kicking it from code, tick Use Transform As Target and set Target Transform to another object, then animate that target with the Animator or Timeline. The follower springs after it, overshooting and settling instead of copying the keys. In Local Space the spring reads the target’s local position and rotation, so keep the target and the follower under the same parent; in World Space it reads world values. The target is read in Update, before the Animator evaluates, so the spring chases the pose from one frame earlier, which you won’t see.
Spring Bones. A Spring Skeleton turns a chain of Transforms into bones that lag and swing as the chain moves. It runs in LateUpdate, after the Animator, and sets each bone’s rotation to its rest pose relative to its parent plus the spring’s lag. On bones the Animator animates, that replaces the animation instead of adding to it, which is why a Spring Skeleton works on a character with no Animator and seems to break on one with an Animator. Put it on chains the Animator leaves alone: hair, a tail, a cape’s or a backpack strap’s bones, an antenna. The Spring Skeleton component can sit under an animated bone, for example on an empty under the head with the hair chain below it: the chain then follows the head and swings behind it. Spring Bones has the setup.
Without a skeleton. A Transform Spring works on any Transform, so a mesh with no bones can still sway, squash or tip on a parent spring. Bending is different: only a skinned mesh bends, and it bends with its bones. A sprite animation that swaps sprites doesn’t touch the Transform either, so a spring on the same object adds freely, unless an Animator also animates that object’s Transform.
What it does not do
Section titled “What it does not do”- Active ragdolls. The Toolkit isn’t a physics character system. Its Rigidbody Spring Component sets the body’s velocity every physics step to follow its spring, so it replaces physics on that body rather than reacting to it, and it shouldn’t share a body with a physics knockback.
- The push itself. There is no knockback or character controller component. The gameplay part of knockback is your movement code, as above; the Toolkit does the visual reaction.
- Springs on animated bones. Neither the Transform Spring nor Spring Bones add to a bone the Animator writes. Use an empty child, or a chain the Animator doesn’t animate.
