---
title: AnimationGraphComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/animationgraphcomponent
---

# AnimationGraphComponent

A component that drives skeletal animation on an entity using a node-based animation graph.

## Declaration

```swift
struct AnimationGraphComponent
```

## Overview

Overview Animation graphs blend and transition between multiple animations at runtime using a graph of connected nodes. Use AnimationGraphComponent to attach a compiled AnimationGraphResource to an entity. RealityKit evaluates the graph each frame and writes the resulting pose to the entity’s SkeletalPosesComponent. Attach a graph to an entity entity.components.set(AnimationGraphComponent(resource: graphResource)) Inspect the active graph state activeNodes reflects all nodes that contributed to the current pose. Use activeStateMachineNodes or activeClipNodes to work directly with a specific node type. for node in component.activeStateMachineNodes {     print("Current state: \(node.currentState)") }

for node in component.activeClipNodes {     print("Current cycle: \(node.currentCycle)") }

## Topics

### Creating a component

- [init(graph:)](realitykit/animationgraphcomponent/init(graph:).md)

### Accessing the graph

- [graph](realitykit/animationgraphcomponent/graph.md)

### Accessing active nodes

- [activeNodes](realitykit/animationgraphcomponent/activenodes.md)
- [AnimationGraphComponent.ActiveNode](realitykit/animationgraphcomponent/activenode.md)
- [activeClipNodes](realitykit/animationgraphcomponent/activeclipnodes.md)
- [AnimationGraphComponent.ActiveClipNode](realitykit/animationgraphcomponent/activeclipnode.md)
- [activeStateMachineNodes](realitykit/animationgraphcomponent/activestatemachinenodes.md)
- [AnimationGraphComponent.ActiveStateMachineNode](realitykit/animationgraphcomponent/activestatemachinenode.md)

### Accessing active tags

- [activeTags](realitykit/animationgraphcomponent/activetags.md)
- [AnimationGraphComponent.ActiveTag](realitykit/animationgraphcomponent/activetag.md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)

## See Also

### Animation graphs

- [AnimationGraphResource](realitykit/animationgraphresource.md)
