# AnimTrack

Class · category: Animation

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/framework/anim/evaluator/anim-track.js#L21

An AnimTrack stores the curve data necessary to animate a set of target nodes. It can be linked
to the nodes it should animate using the [AnimComponent#assignAnimation](https://api.playcanvas.com/engine/classes/AnimComponent.md#assignanimation) method.

A track is the engine's animation clip: a [name](https://api.playcanvas.com/engine/classes/AnimTrack.md#name), a [duration](https://api.playcanvas.com/engine/classes/AnimTrack.md#duration) in seconds and a list
of [curves](https://api.playcanvas.com/engine/classes/AnimTrack.md#curves), each of which reads keyframe times from one of the [inputs](https://api.playcanvas.com/engine/classes/AnimTrack.md#inputs) and values
from one of the [outputs](https://api.playcanvas.com/engine/classes/AnimTrack.md#outputs), and writes the result to a target path such as a node's local
position or a component property. Optional [events](https://api.playcanvas.com/engine/classes/AnimTrack.md#events) fire at set times during playback.
Tracks come from `animation` assets, GLB animations among them, and are what an
[AnimState](https://api.playcanvas.com/engine/classes/AnimState.md) plays; one track can be assigned in any number of components.

## Properties

### EMPTY

```ts
static EMPTY: AnimTrack
```

This AnimTrack can be used as a placeholder track when creating a state graph before having all associated animation data available.

## Accessors

### curves

```ts
get curves(): AnimCurve[]
```

Gets the list of curves contained in the AnimTrack.

### duration

```ts
get duration(): number
```

Gets the duration of the AnimTrack.

### events

```ts
get events(): AnimEvents
set events(animEvents: AnimEvents)
```

Gets the animation events that will fire during the playback of this anim track.

### inputs

```ts
get inputs(): AnimData[]
```

Gets the list of curve key data contained in the AnimTrack.

### name

```ts
get name(): string
```

Gets the name of the AnimTrack.

### outputs

```ts
get outputs(): AnimData[]
```

Gets the list of curve values contained in the AnimTrack.
