Repository navigation
API Class Animator
Defined in: src/plugins/animation/runtime/components/Animator.ts:40
Base class for everything attached to a node: built-in engine components and user
GameBehaviors (ADR 0007, 0009). Instances are created by the engine
(node.addBehavior(Type) or scene loading), never with new by game code.
new Animator(): Animator;Animator
cullingMode: AnimatorCullingMode = "always";Defined in: src/plugins/animation/runtime/components/Animator.ts:72
What it does while no camera sees it: keep animating, freeze the pose while playheads advance, or keep only root motion.
defaultClip: string = "";Defined in: src/plugins/animation/runtime/components/Animator.ts:51
A clip the implicit graph plays on start when there is no graph (Unity's legacy Animation, Godot's autoplay). Empty:
nothing plays until code calls play.
graph: string = "";Defined in: src/plugins/animation/runtime/components/Animator.ts:45
The animation graph (*.animgraph.json). Empty: an implicit single-layer graph that play and crossfade drive.
ikTargetNodes: (GameObject | null)[] = [];Defined in: src/plugins/animation/runtime/components/Animator.ts:106
The node each of ikTargets follows (its world transform, every frame).
ikTargets: string[] = [];Defined in: src/plugins/animation/runtime/components/Animator.ts:103
IK goals of the graph's rig stack bound to nodes, by goal name; ikTargetNodes[i] is goal ikTargets[i]'s target.
linkedGraphNodes: string[] = [];Defined in: src/plugins/animation/runtime/components/Animator.ts:54
Linked-graph nodes to run another graph in, by node name; linkedGraphs[i] replaces node linkedGraphNodes[i]'s default.
linkedGraphs: string[] = [];Defined in: src/plugins/animation/runtime/components/Animator.ts:57
The graph each of linkedGraphNodes runs (*.animgraph.json); an empty entry keeps the node's default.
lodEvery2: number = 20;Defined in: src/plugins/animation/runtime/components/Animator.ts:88
Past this distance (metres), or below this screen-height share, the pose updates every 2nd frame, interpolated between.
lodEvery4: number = 40;Defined in: src/plugins/animation/runtime/components/Animator.ts:91
Past this distance, or below this screen-height share, the pose updates every 4th frame.
lodMetric: AnimatorLodMetric = "off";Defined in: src/plugins/animation/runtime/components/Animator.ts:85
What update-rate LOD measures: nothing (every frame), distance to the camera, the share of the screen's height, or
the enclosing LODGroup's level for the main camera (ADR 0542 §6: level 0 updates every frame, level 1 every 2nd,
level 2 and below every 4th; a group culled by LOD counts as not visible for cullingMode).
lodSearchMultiplier: number = 2;Defined in: src/plugins/animation/runtime/components/Animator.ts:97
At each slower LOD rate, motion-matching searches run this many times less often.
parameters: Record<string, number | boolean | number[]> = {};Defined in: src/plugins/animation/runtime/components/Animator.ts:63
Starting values of graph parameters, by name, overriding the graph asset's defaults: numbers, booleans, and number
arrays for vec2, vec3 and quat (node parameters start empty). Edited in the Animator's Inspector section.
rigCullDistance: number = 0;Defined in: src/plugins/animation/runtime/components/Animator.ts:94
Past this distance (metres) the rig stack and spring bones switch off; 0 keeps them on.
rootMotion: AnimatorRootMotion = "none";Defined in: src/plugins/animation/runtime/components/Animator.ts:75
Where root motion goes. characterController and rigidBody need the physics plugin; every mode fills the RootMotion buffer.
updateMode: AnimatorUpdateMode = "normal";Defined in: src/plugins/animation/runtime/components/Animator.ts:69
How its time advances: the World's scaled time, unscaled time, or fixed steps before physics (physics-driven and predicted characters).
get enabled(): boolean;Defined in: src/engine/core/Component.ts:63
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:67
boolean
void
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:43
Unity-style alias for node.
get isActiveAndEnabled(): boolean;Defined in: src/engine/core/Component.ts:74
True when enabled, the node is active in the hierarchy, and the node is in a loaded world.
boolean
get node(): GameObject;Defined in: src/engine/core/Component.ts:38
The node this component is on.
get onFinished(): Promise<AnimationPlayResult>;Defined in: src/plugins/animation/runtime/components/Animator.ts:213
The latest play's promise: it resolves when that play ends, by finishing, interruption or stop.
Promise<AnimationPlayResult>
get owner(): GameObject;Defined in: src/engine/core/Component.ts:51
The node this component acts for: the node itself when attached directly, or the parent node when this component lives on a component node (ADR 0009).
get time(): Readonly<TimeState>;Defined in: src/engine/core/Component.ts:99
This component's World's clock (ADR 0032): the same values as Time, but safe to read
outside the World's frame too (after an await, say).
Readonly<TimeState>
get transform(): Transform;Defined in: src/engine/core/Component.ts:57
The Transform of the node this component is on, if it has one.
get world(): WorldHandle;Defined in: src/engine/core/Component.ts:88
A handle on this component's World (ADR 0132): the same one Engine.findWorld returns. Load
a scene into it, pause, connect or destroy it: this.world.loadScene("scenes/level2.scene.json").
Throws for a World no Engine owns.
bone(name): AnimatorBone;Defined in: src/plugins/animation/runtime/components/Animator.ts:208
A bone of the skeleton, to read this frame's pose and override it from lateUpdate(): anim.bone("Head").localRotation = q.
string
compute(name, fn): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:193
Fill a parameter from fn once per frame, before evaluation (computed parameters, ADR 0372): transitions read it like
any other parameter, the debugger shows it and takes record it. Null stops it.
string
| (() => AnimatorParameterValue)
| null
void
crossfade(
clip,
duration,
options?
): Promise<AnimationPlayResult>;Defined in: src/plugins/animation/runtime/components/Animator.ts:165
Fade from what is playing to clip over duration seconds (play with a fade, plus an avatar mask).
string
number
Promise<AnimationPlayResult>
ik(name): AnimatorIKTarget;Defined in: src/plugins/animation/runtime/components/Animator.ts:198
An IK goal of the graph's rig stack, by name, to aim from code: anim.ik("LeftHand").target(grip, { weight: 1 }).
string
instantiate(prefabPath, options?): GameObject;Defined in: src/engine/core/Component.ts:109
Instantiate a prefab in this component's World (ADR 0034), like GameObject.instantiate.
Use it in code that may run after an await: by then the frame is over and the current World
is the Engine's default one, which may not be this component's. A parent from another
World throws.
string
InstantiateOptions = {}
jump(state, options?): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:150
Cut straight to state, with no path and no blend (inertialized).
string
AnimatorJumpOptions = {}
void
layerWeight(layer, weight): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:180
Set a layer's weight, 0–1.
number
void
link(node, linked): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:175
Run linked (*.animgraph.json) in the linked-graph node node (weapon layers); null puts back the node's default.
string
string | null
void
play(clip, options?): Promise<AnimationPlayResult>;Defined in: src/plugins/animation/runtime/components/Animator.ts:160
Play a clip: in a graph slot as a one-shot over the graph ({ slot: "UpperBody" }), or, on an Animator without a
graph, on a layer of the implicit graph. clip is a clip asset (asset:anims/slash.anim.json, asset:hero.glb#Anim/Run)
or a clip named in the graph. The promise resolves when the play ends, with finished, interrupted (another play
took over) or stopped.
string
AnimatorPlayOptions = {}
Promise<AnimationPlayResult>
request(name, options?): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:136
Ask for a transition that reads name (no triggers, ADR 0372): the request stays open for within seconds (default
0.25), is consumed by the first transition that reads it, and otherwise expires, so it never fires late.
string
void
set(name, value): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:128
Set a graph parameter. The value must match the parameter's kind (float, int, bool, vec2, vec3, quat or node).
string
void
state(layer?): AnimatorStateInfo;Defined in: src/plugins/animation/runtime/components/Animator.ts:185
The active state of a layer (default 0), as of the last evaluation.
AnimatorLayer = 0
stop(options?): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:170
Stop plays: on one layer, in one slot, or (with neither) all of them; their promises resolve with stopped.
AnimatorStopOptions = {}
void
travel(state, options?): Promise<AnimatorTravelResult>;Defined in: src/plugins/animation/runtime/components/Animator.ts:145
Go to state by the shortest path through the layer's state machine (Godot's travel), using each hop's timing and
blend. The promise resolves when the machine gets there (arrived), when no path leads there (unreachable, with a
warning), or when another travel or jump comes first (interrupted).
string
Promise<AnimatorTravelResult>
warp(window, target): void;Defined in: src/plugins/animation/runtime/components/Animator.ts:203
Where the motion-warp window window (a cue marker range of the playing clip) should land; null clears it.
string
AnimatorWarpTarget | null
void
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference