Home
Shaders and presets

Animation Presets

Pre-configured animation settings for characters and creatures

Ready-to-use animation configurations for character movement and behavior.

Quick Start

import { createAnimationPreset, AnimationPresets } from 'strata-game-library/presets/animation';

<Character animation={AnimationPresets.HUMANOID_WALK} />

Available Presets

PresetDescriptionUse Case
HUMANOID_WALKBipedal walk cycleHuman characters
HUMANOID_RUNBipedal run cycleHuman running
QUADRUPED_WALKFour-legged walkDogs, horses
QUADRUPED_RUNFour-legged runFast animals
BIRD_FLYWing flappingFlying creatures
FISH_SWIMUndulating motionAquatic
SPIDER_CRAWLEight-leggedArachnids

Preset Examples

Humanoid Walk

AnimationPresets.HUMANOID_WALK = {
  type: 'procedural',

  gait: {
    speed: 1.5,
    strideLength: 0.8,
    strideDuration: 0.6,
  },

  body: {
    bounce: 0.03,
    sway: 0.02,
    lean: 0.05,
  },

  arms: {
    swing: 0.3,
    swingOffset: Math.PI,
  },

  legs: {
    lift: 0.15,
    bendAngle: 0.4,
  },

  ik: {
    footPlacement: true,
    hipAdjustment: true,
  },
};

Quadruped Run

AnimationPresets.QUADRUPED_RUN = {
  type: 'procedural',

  gait: {
    pattern: 'gallop',
    speed: 8,
    strideLength: 2.5,
  },

  body: {
    bounce: 0.15,
    stretch: 0.1,
  },

  legs: {
    frontPhase: 0,
    backPhase: 0.5,
    lift: 0.4,
  },

  spine: {
    flex: 0.2,
    twist: 0.1,
  },
};

Using with Components

import { Character } from 'strata-game-library/core';
import { AnimationPresets } from 'strata-game-library/presets/animation';

<Character
  model={characterModel}
  animation={isRunning ? AnimationPresets.HUMANOID_RUN : AnimationPresets.HUMANOID_WALK}
/>