---
title: AnimationGraphResource
framework: realitykit
role: symbol
role_heading: Class
path: realitykit/animationgraphresource
---

# AnimationGraphResource

A compiled animation graph resource that drives skeletal animation on an entity.

## Declaration

```swift
class AnimationGraphResource
```

## Overview

Overview An AnimationGraphResource can be produced by compiling a JSON graph definition. Once compiled, assign it to an entity via AnimationGraphComponent to begin driving animation: let resource = try AnimationGraphResource(definition: Data(animationGraphDefinition.utf8), nodeResourceMapping: clips, skeletonResource: skeleton) entity.components.set(AnimationGraphComponent(graph: resource)) Parameters The graph exposes a set of named parameters that control its behavior at runtime, such as movement speed or a trigger to initiate a transition. Read the available parameters via parameterNames. To set values at runtime, use the entity’s parameter binding: entity.parameters["MoveSpeed"] = BindableValue(Float(1.0))

## Topics

### Creating an animation graph

- [init(definition:nodeResourceMapping:skeletonResource:)](realitykit/animationgraphresource/init(definition:noderesourcemapping:skeletonresource:).md)
- [validate(definition:nodeResourceMapping:skeletonResource:)](realitykit/animationgraphresource/validate(definition:noderesourcemapping:skeletonresource:).md)

### Accessing parameters

- [parameterNames](realitykit/animationgraphresource/parameternames.md)

## Relationships

### Conforms To

- [Resource](realitykit/resource.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Animation graphs

- [AnimationGraphComponent](realitykit/animationgraphcomponent.md)
