One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

AnimationGraphComponent

struct · iOS 27.0+ · SDK 27.1

struct AnimationGraphComponent

A component that drives skeletal animation on an entity using an animation graph. ``AnimationGraphComponent`` attaches a compiled ``AnimationGraphResource`` to an entity. The component evaluates the graph each frame, computes a skeletal pose by blending and transitioning between animation clips, and applies the resulting pose to the entity's ``SkeletalPosesComponent``. Multiple components in the same scene can reference the same resource, which lets a single graph drive many entities without duplicating its underlying data. Each component keeps its own per-instance evaluation state — animation timing, state-machine progress, and parameter values — so characters that share a graph stay independent. ### Attach a graph to an entity ```swift entity.components.set(AnimationGraphComponent(graph: graphResource)) ``` ### Inspect the active graph state The component exposes the graph's runtime state for debugging and for building tools that visualize what a character is doing. ``activeNodes`` returns every node that contributed to the most recent pose. To work with a single kind of node, iterate ``activeStateMachineNodes`` or ``activeClipNodes`` instead — those collections return the narrower ``ActiveStateMachineNode`` and ``ActiveClipNode`` types, which expose only the fields that apply to that node kind. ```swift for node in component.activeStateMachineNodes { print("\(node.name): state \(node.currentState)") } for node in component.activeClipNodes { print("\(node.name): cycle \(node.currentCycle)") } ``` To observe outputs the graph emits back to the rest of the application, read ``activeTags``. Tags are graph-level signals that the graph raises while certain states are active.

Members (6)

get · iOS 27.0+

activeTags

TypeScript
get activeTags(): Array<AnimationGraphComponent_ActiveTag>
Swift declaration
var activeTags: [AnimationGraphComponent.ActiveTag] { get }

The tags that were active or fired during the most recent graph evaluation tick.

get · iOS 27.0+

activeNodes

TypeScript
get activeNodes(): Array<SDKHandle>
Swift declaration
var activeNodes: [any AnimationGraphComponent.ActiveNode] { get }

Every node that contributed to the most recent graph evaluation tick. The returned array is a snapshot — its element type is `any` ``ActiveNode``, so each entry exposes only the fields common to all node kinds. To inspect node-kind- specific state, downcast each element to ``ActiveStateMachineNode`` or ``ActiveClipNode``, or iterate ``activeStateMachineNodes`` or ``activeClipNodes`` for the same view filtered to a single kind.

get · iOS 27.0+

activeClipNodes

TypeScript
get activeClipNodes(): Array<AnimationGraphComponent_ActiveClipNode>
Swift declaration
var activeClipNodes: [AnimationGraphComponent.ActiveClipNode] { get }

The animation clip nodes that were active during the most recent graph evaluation tick. This is the typed view of ``activeNodes`` filtered to ``ActiveClipNode``.

get · iOS 27.0+

activeStateMachineNodes

TypeScript
get activeStateMachineNodes(): Array<AnimationGraphComponent_ActiveStateMachineNode>
Swift declaration
var activeStateMachineNodes: [AnimationGraphComponent.ActiveStateMachineNode] { get }

The state machine nodes that were active during the most recent graph evaluation tick. This is the typed view of ``activeNodes`` filtered to ``ActiveStateMachineNode``.

get · iOS 27.0+

graph

TypeScript
get graph(): AnimationGraphResource
Swift declaration
var graph: AnimationGraphResource { get }

The compiled animation graph that backs this component.

init · iOS 27.0+

init

TypeScript
static init(graph: AnimationGraphResource): AnimationGraphComponent
Swift declaration
init(graph: AnimationGraphResource)

Creates a component that drives skeletal animation on an entity using the supplied compiled animation graph. Per-instance evaluation state initializes when the entity becomes active in a scene, so accessors such as ``activeNodes`` return an empty array until the first evaluation tick has run. - Parameter graph: The compiled ``AnimationGraphResource`` that drives this component.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →