# AnimNode

Class · category: Animation

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/framework/anim/controller/anim-node.js#L19

AnimNodes are used to represent a single animation track in the current state. Each state can
contain multiple AnimNodes, in which case they are stored in a BlendTree hierarchy, which will
control the weight (contribution to the states final animation) of its child AnimNodes.

`animTrack` is the clip the node plays, `speed` multiplies its playback rate, and
`weight` is set by the parent blend tree, or is one for a node that is the state's only
animation.

## Constructors

### constructor

```ts
new AnimNode(state: AnimState, parent: AnimBlendTree | null, name: string, point: number | number[], speed?: number)
```

Create a new AnimNode instance.

**Parameters**

- `state` ([`AnimState`](https://api.playcanvas.com/engine/classes/AnimState.md)): The AnimState that this BlendTree belongs to.
- `parent` ([`AnimBlendTree`](https://api.playcanvas.com/engine/classes/AnimBlendTree.md) `| null`): The parent of the AnimNode. If not null, the AnimNode
  is stored as part of an [AnimBlendTree](https://api.playcanvas.com/engine/classes/AnimBlendTree.md) hierarchy.
- `name` (`string`): The name of the AnimNode. Used when assigning an [AnimTrack](https://api.playcanvas.com/engine/classes/AnimTrack.md) to
  it.
- `point` (`number | number[]`): The coordinate/vector that's used to determine the weight of
  this node when it's part of an [AnimBlendTree](https://api.playcanvas.com/engine/classes/AnimBlendTree.md).
- `speed` (`number`, optional, default `1`): The speed that its [AnimTrack](https://api.playcanvas.com/engine/classes/AnimTrack.md) should play at. Defaults to 1.
