Union of state names added via .state(). Used for autocomplete and validation in .transition() and .defaultState().
Record mapping parameter names to their types ("trigger", "bool", "float", "int"). Used for type-aware .condition() overloads.
Optionalname: stringBuilds and returns the AnimatorController. Resolves all state name references to indices.
Optionalroot: Object3D<Object3DEventMap>Optional root Object3D for resolving TrackDescriptor track paths.
When provided, tracks targeting a different object use target.name for named resolution.
Adds a condition to the most recently added transition. Multiple conditions on the same transition are AND-ed together.
The required arguments depend on the parameter type:
.condition("Jump") — mode defaults to "if", no threshold needed.condition("Open", "if") or .condition("Open", "ifNot").condition("Speed", "greater", 0.1)Name of the parameter to evaluate
Optionalmode: "if" | "ifNot"Adds a condition to the most recently added transition. Multiple conditions on the same transition are AND-ed together.
The required arguments depend on the parameter type:
.condition("Jump") — mode defaults to "if", no threshold needed.condition("Open", "if") or .condition("Open", "ifNot").condition("Speed", "greater", 0.1)Name of the parameter to evaluate
Adds a condition to the most recently added transition. Multiple conditions on the same transition are AND-ed together.
The required arguments depend on the parameter type:
.condition("Jump") — mode defaults to "if", no threshold needed.condition("Open", "if") or .condition("Open", "ifNot").condition("Speed", "greater", 0.1)Name of the parameter to evaluate
Optionalthreshold: numberSets which state is the default/entry state. If not called, the first added state is used.
Name of the state
Adds a state to the controller. The first state added becomes the default state.
When options.clip is provided, the state uses that clip directly.
When omitted, chain .track() calls to define animation tracks inline:
.state("Open", { loop: true })
.track(door, "position", { from: [0,0,0], to: [2,0,0], duration: 1 })
.track(light, "intensity", { from: 0, to: 5, duration: 1 })
Unique name for the state
Optionaloptions: StateOptionsState configuration including clip, loop, speed. When omitted, use .track() to add animation data.
Adds an animation track for an Object3D's position or scale to the current state
Optionaloptions: TrackOptionsAdds an animation track for an Object3D's quaternion to the current state
Optionaloptions: TrackOptionsAdds an animation track for an Object3D's rotation (Euler, converted to quaternion) to the current state
Optionaloptions: TrackOptionsAdds an animation track for an Object3D's visibility to the current state
Optionaloptions: TrackOptionsAdds an animation track for a material's numeric property to the current state
Optionaloptions: TrackOptionsAdds an animation track for a material's color property to the current state
Optionaloptions: TrackOptionsAdds an animation track for a light's numeric property to the current state
Optionaloptions: TrackOptionsAdds an animation track for a light's color to the current state
Optionaloptions: TrackOptionsAdds an animation track for a camera's numeric property to the current state
Optionaloptions: TrackOptionsAdds a transition between two states.
Use "*" as the source to create a transition from any state.
Chain .condition() calls after this to add conditions.
Source state name, or "*" for any-state transition
Destination state name
Optionaloptions: TransitionOptionsTransition configuration
StaticcreateCreates a new AnimatorControllerBuilder instance.
Optionalname: stringOptional name for the controller
A fluent builder for creating AnimatorController instances from code.
Use AnimatorControllerBuilder.create or AnimatorController.build to create a new builder.
The builder tracks state names and parameter types through the fluent chain, providing autocomplete for state names in
.transition()and type-aware.condition()calls (e.g., trigger parameters don't require a mode argument).Example: With pre-built AnimationClips
Example: With inline tracks (no pre-built clips needed)