menu_bookDocumentation

Animation - s&box Documentation

calendar_today May 5, 2026 schedule ~1 min read person patrickjr verified 50

Animation

s&box supports skeletal animation for characters and objects. Animate models using imported animations, blend between states, and control playback from code.

Movie Maker

The Movie Maker tool can create skeletal animations that are usable in-game:

  1. Animate character poses over time
  2. Export as animation asset
  3. Use in your game's SkinnedModelRenderer

Animation System

Character animation uses the SkinnedModelRenderer component:

CSHARP
var renderer = Components.Get<SkinnedModelRenderer>();

// Play an animation
renderer.PlayAnimation( "run" );

// Blend between animations
renderer.SetAnimParameter( "speed", velocity.Length );

Animation Parameters

Control animation state through parameters:

CSHARP
// Set float parameter
renderer.SetAnimParameter( "speed", 5.0f );

// Set boolean parameter
renderer.SetAnimParameter( "is_jumping", true );

// Set integer parameter
renderer.SetAnimParameter( "weapon_type", 1 );

Animation Events

Receive events from animations (footsteps, sounds):

CSHARP
protected override void OnAnimEvent( string name, string parameter )
{
    if ( name == "footstep" )
    {
        PlayFootstepSound();
    }
}

SceneAnimationSystem

For complex animation management, use the scene animation system:

CSHARP
// Access via Scene
var animSystem = Scene.GetSystem<SceneAnimationSystem>();

Sources

Animations come from:

  • Imported FBX files with skeletal animation
  • Movie Maker created animations
  • Procedural animation (IK, ragdolls)
See SkinnedModelRendereropen_in_new for detailed animation API.
Was this helpful?