> For the complete documentation index, see [llms.txt](https://xeavin.gitbook.io/the-insurgents-handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xeavin.gitbook.io/the-insurgents-handbook/scripts/vm-call-targets/motion-play.md).

# Motion Play

### Signature

```c
void motionplay(int flags); //id:0x00a5
```

### Description

Plays a custom motion of a character (current script).

### Arguments

#### Flags: Motion Group Identifier

The group of the motion that will be played. Before calling this function, the motion group must be loaded via the [Motion Read](/the-insurgents-handbook/scripts/vm-call-targets/motion-read.md) function first.

#### Flags: Motion Identifier

The motion that will be played.

#### Flags: Unknown 1

This argument should always be set to `1`, otherwise this function will just return. Otherwise it serves no purpose.

### Notes

{% hint style="warning" %}
Some motions are looped (e.g. idling) while others aren't (e.g. laughing). So to avoid the character from freezing at the last frame of the animation, it's important to either play a non-looped animation in a loop via your code or play a looped animation like idling after a non-looped one. You can do the latter either manually or automatically via the [Set Auto Relax](/the-insurgents-handbook/scripts/vm-call-targets/set-auto-relax.md) function.
{% endhint %}

{% hint style="info" %}
If a character is already playing a motion, it will be cancelled before playing the new one.
{% endhint %}

{% hint style="info" %}
Depending on an unknown state of the current script, this function may just return.
{% endhint %}

{% hint style="info" %}
Technically, all motions that can be played with the [Std Motion Play](/the-insurgents-handbook/scripts/vm-call-targets/std-motion-play.md) function, can also be played with this one. However, I would still recommend using both for the reasons they were created in order to avoid confusion and the like.
{% endhint %}
