Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Component · animation

Animator

Skeletal animation for this entity's MeshRenderer.model, compiled to an ara-anim program: the controller document when set, else an idle state and a move state whose 1D blend tree is driven by the entity's ground speed, cross-faded at moveThreshold.

Fields

controller

option<asset<animation>>
Controller authored in an .animation document (@anim/fox.animation#an_fox): its state machine, blend trees and motion matching replace the built-in idle/locomotion graph below. A float speed parameter follows ground speed.
default null

idle

string
Idle clip name.
default ""

locomotion

list<LocomotionClip>
Moving blend samples in increasing speed order.
default []

moveThreshold

f32
Ground speed separating idle from moving.
default 0.15m/s≥ 0

fade

f32
Cross-fade duration between idle and moving.
default 0.2s≥ 0

rootMotion

bool
Moves the entity by the extracted root motion (only without a character controller or navigation agent, which own movement).
default false

Usage

Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.

Add it

ara do component.add -p entity=name:Crate -p component=Animator --why "Add Animator"

Set a field

ara do property.set -p entity=name:Crate -p path=Animator.controller -p value=null --why "Tune Animator"

In a scene document

{
  "Animator": {
    "controller": null
  }
}

From C#

/// <summary>Blend between idle and locomotion over 300 ms.</summary>
public static void UseAnimator(Entity entity, in Tick tick)
{
    ref var component = ref World.Get<Animator>(entity);
    component.Fade = 0.3f;
}

From C#

Scripts read and write it with Get<Animator>(); see the Animator struct.