playAnimation
Plays an animation on the player.
Network Sync on Client and Server
When networkSync
is set to true
, the animation will be synced with other players. This means that other players will see the animation playing on the player
Client: Can only be used on the local player; using it on other players will have no effect.
Server: Can be used on any player.
You can have a maximum of 16
animations synced at the same time. If you try to sync more than 16
animations, an error will be thrown.
Syntax
player.playAnimation(animId, options, networkSync);
Parameters
Name | Type | Description |
---|---|---|
animId | string | The ID of the animation to play. |
options | AnimationOptions[] | The animation to play on the player. |
networkSync (optional) | boolean | Whether to sync the animation with other players. Default: true |
Example
player.playAnimation('dance', {
loop: 'repeat';
}, true);
Available on: Client Server