Razorbill
Components

Animation Components

AnimatorComponent

Controls animation playback on an entity. Supports single clip playback and a locomotion state machine that blends between idle, walk, run, jump, and other movement states based on character velocity.

Core Properties

PropertyTypeDefaultDescription
controller_modeEnumclipMode: clip (single clip) or locomotion (state machine)
default_clip_guidGuidnullGUID of default animation clip
play_on_startBooltrueAuto-play when entering play mode
loopBooltrueLoop the animation
speedFloat1.0Playback speed multiplier (min: 0)
apply_root_motionBoolfalseApply root bone motion to entity transform

Locomotion Properties

When controller_mode is locomotion, these properties control the state machine:

PropertyTypeDefaultDescription
locomotion_enabledBoolfalseEnable locomotion blending
wall_locomotion_enabledBoolfalseEnable wall-run/slide states
walk_speed_thresholdFloat0.15Speed threshold for idle → walk transition
run_speed_thresholdFloat3.0Speed threshold for walk → run transition
blend_smoothingFloat12Blend interpolation speed

State Clip Assignments

Each locomotion state maps to an animation clip by name:

PropertyState
state_clip_idleStanding still
state_clip_walkWalking
state_clip_runRunning
state_clip_jump_startJump takeoff
state_clip_in_air_upRising in air
state_clip_in_air_downFalling
state_clip_landLanding
state_clip_wall_runWall running
state_clip_wall_slideWall sliding
state_clip_crouch_walkCrouching movement
state_clip_slide_steepSliding on steep slope

Scripting: Animation Control

void OnUpdate(ScriptContext* ctx) {
    // Play a specific clip
    ctx->play_animation_clip(ctx, ctx->self, "<clip-guid>", true);

    // Set animation speed
    ctx->set_animation_speed(ctx, ctx->self, 1.5f);

    // Set locomotion parameters
    ctx->set_animation_param_float(ctx, ctx->self, "speed", 5.0f);
    ctx->set_animation_param_bool(ctx, ctx->self, "grounded", true);

    // Query current state
    const char* state = ctx->get_animation_state(ctx, ctx->self);

    // Stop animation
    ctx->stop_animation(ctx, ctx->self);
}

JointComponent

Connects two entities with a physics joint. Supports fixed, hinge, and distance joint types.

PropertyTypeDefaultDescription
joint_typeEnumfixedType: fixed, hinge, or distance
other_entityString""Name of the other entity to connect to
anchor1Vec3{x:0, y:0, z:0}Anchor point on this entity (local space)
anchor2Vec3{x:0, y:0, z:0}Anchor point on the other entity (local space)
break_forceFloat0Force threshold to break the joint (0 = unbreakable)
break_torqueFloat0Torque threshold to break the joint (0 = unbreakable)

Hinge Joint Parameters

PropertyDefaultDescription
hinge_params.axis{x:0, y:1, z:0}Rotation axis
hinge_params.has_limitsfalseWhether rotation is limited
hinge_params.min_angleMinimum angle in radians
hinge_params.max_angleπMaximum angle in radians

Distance Joint Parameters

PropertyDefaultDescription
distance_params.min_distance-1Minimum distance (-1 = no limit)
distance_params.max_distance-1Maximum distance (-1 = no limit)

Example: Door Hinge

{
  "op": "AddComponent",
  "params": {
    "entity_name": "Door",
    "component_type": "JointComponent",
    "data": {
      "joint_type": "hinge",
      "other_entity": "DoorFrame",
      "anchor1": { "x": -0.5, "y": 0, "z": 0 },
      "anchor2": { "x": 0.5, "y": 0, "z": 0 },
      "hinge_params": {
        "axis": { "x": 0, "y": 1, "z": 0 },
        "has_limits": true,
        "min_angle": 0,
        "max_angle": 1.57
      }
    }
  }
}

On this page