# Animation Player

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

[Animation Player](/ref/animation.AnimationPlayer.md) plays its Clip, from the start of Play when Play On Start is set. Speed scales time; a negative speed plays backwards. Loop overrides the loop mode of the clip.

In Try it, the runner plays the built-in run clip and the pendulum plays a separate bob clip. Press R to replay the runner or B to reverse it; their scripts show presentation and gameplay events.

| Method | |
|---|---|
| `Play(clip)` | start a clip from the beginning; `nil` plays the current clip again |
| `Stop()` | end the clip; `restore` tracks get their old values, `Finished(-1)` runs |
| `Pause()`, `Resume()` | hold and continue |
| `Seek(t)` | jump to a time in the clip without firing the events in between |
| `SetSpeed(s)` | change the speed |

| Signal | |
|---|---|
| `Finished(cycle int)` | a clip that does not loop ended (`0`), or `Stop` (`-1`) |
| `Event(id int, payload float)` | the clip reached an event |

Commands take effect on the next fixed step, so a script may call them from Update. Time, Playing and Cycle show the state during Play.

A track whose node is missing ([ANM005](/diagnostics.html#ANM005.md)) or whose property does not match its kind ([ANM001](/diagnostics.html#ANM001.md)) is off; the rest of the clip plays. When a clip is imported again with the same tracks, the players keep their place; with other tracks they stop ([ANM008](/diagnostics.html#ANM008.md)).
