motion_2d
2D: lifelike animation for a rig_2d character, made from numbers instead of drawn frames: breathing, walk and run blended by speed, jump take-off / rise / apex / fall / landing squash, turn-arounds and slope lean; melee wind-up, strike and follow-through with smear copies, aiming, hurt flinch, knockback and death; hair and capes on springs; and a Paper Forge face's blinks, eye look-at, talking mouth shapes and emotions. It follows the body, the anim_2d state and script calls. Scripts: self.motion.play("attack"), .emotion("angry"), .say("Hello there"), .aim(30), .lookAt(p), .die(). Messages: onMessage 'motion' { event: telegraph | strike | contact | land | step | dead }.
In scene text
motion_2d { body "…" weight 1 breath 1 }Add it in the Inspector (Add Component), in scene text as above, or ask your AI. Fields you leave out keep their defaults.
Fields 24
| Field | Type | Unit / range | What it does |
|---|---|---|---|
body | text | — | How it moves: "biped" (legs and arms), "blob" (one squashy body: slimes), "flyer" (wings), "npc" (stands, gestures and talks). |
weight | number | 0.3 … 3 | Heaviness of everything: 0.6 nimble, 1 normal, 2 a golem. Slower wind-ups, bigger follow-through, heavier landings. |
breath | number | 0 … 3 | Idle breathing: 0 none, 1 natural, 2 panting. |
stride | number | 0.3 … 3 | Stride length (1: from its leg length). |
walk_speed | number | units/s, 1 … 5000 | Speed of a full walk. |
run_speed | number | units/s, 1 … 10000 | Speed where the run has fully taken over (walk and run blend between). |
bounce | number | 0 … 3 | Body bob and landing bounce (0 none). |
lean | number | 0 … 3 | Leaning into speed, turns and slopes (0 none). |
squash | number | 0 … 3 | Squash and stretch on take-off, landing and hits (drawing only; the body box never changes). |
attack | text | — | The main attack's move. |
attack_weight | number | 0.3 … 3 | How heavy the attack is: 0.6 snappy, 1 standard, 1.8 heavy, 2.5 crushing (wind-up, hold, follow-through, arc). |
attack_arc | number | 0 … 2 | Swing size (1 standard). |
smear | number | 0 … 2 | Smear copies on fast swings (0 off). |
hurt | number | 0 … 3 | Flinch strength when hit (0 none). |
death | text | — | How it dies: crumple (knees give, it folds and drops), fall (topples stiffly), scatter (falls apart: skeletons), pop (bursts: slimes), none. |
dash | number | 0 … 3 | Dash lean and stretch (0 none). |
blink | number | s, 0 … 30 | Seconds between blinks (0 never). |
emotion | text | — | The face's emotion (eyes, brows and mouth from the rig's alternative parts, plus body language). |
look | number | 0 … 2 | Eyes and head following a target: the player for enemies and people, or self.motion.lookAt (0 off). |
talk_rate | number | 1/s, 1 … 30 | Mouth shapes per second while talking. |
telegraph | number | s, 0 … 2 | Warning before its attacks land: eyes glare and it glows for this long during the wind-up (enemies). |
telegraph_color | colour (r, g, b) | — | The warning glow's colour. |
actions | list of text | — | State or clip names -> moves: ["attack=slash", "slam=smash weight=2", "hop=lunge"] (moves: slash, thrust, smash, throw, lunge, wave, dash, hurt). |
roles | list of text | — | Bone roles when the names don't say: ["arm=arm_r", "arm_far=arm_l", "torso=chest"] (roles: root, hips, torso, head, arm, arm_far, leg, leg_far, wing, wing_far, eyes, pupils, mouth, brows, weapon). |