Contents

AnimationGraphResource

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

Declaration

class AnimationGraphResource

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

Accessing parameters

See Also

Animation graphs