StartAnim
startAnim
Starts an allowlisted scripted visual animation for a connected player and synchronizes it with relevant clients.
Syntax
bool startAnim(int playerId, string animation [, bool looped = false, number blendSeconds = 0.15])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
animation |
string |
yes | A case-insensitive alias from the Player animation catalog. Raw Unreal asset paths are not accepted. |
looped |
bool |
no | Whether to hold and replay the animation from its catalog loop point. The compatible default remains false, even for aliases whose authored mode is hold.
|
blendSeconds |
number |
no | Requested owning-player native montage transition/stop duration from 0 to 2 seconds; defaults to 0.15. When this request replaces an existing scripted animation, it controls that outgoing montage and is then retained for a later stop of the new animation. |
Returns
Returns true when the server validates the request, records the authoritative animation state, and attempts reliable delivery. This is not a client playback or transport acknowledgement. Returns false for an invalid player, alias, argument, or inactive player session.
Examples
Hold the allowlisted prayer animation until it is stopped:
if not startAnim(playerId, "pray", true, 0.2) then
outputDebugString("Prayer animation request was rejected")
end
Notes
- Available only in server-side resource scripts.
- Player animation catalog documents the earlier 118 aliases. From 0.1.9, Activity animation catalog adds 844 entries (962 total), including route/gesture variants; these additions are not all individually visually confirmed. Use getPlayerAnimationNames and getPlayerAnimationInfo to enumerate the running server catalog and recommended modes. Selected introduction/loop/exit playback retains the existing signature and default looped=false.
- The optional
loopedargument explicitly controls the request. Omitting it always requests a one-shot animation; the catalog mode is an authored recommendation, not an implicit override. - Starting another scripted animation replaces the player's current scripted animation. Normal replicated gameplay actions retain their own presentation rules.
- Use
stopAnimto end the tracked scripted animation. Clients use bounded loading and presentation retries for the newest accepted revision; a terminal miss is written to the animation diagnostic log instead of retrying forever. - The requested blend is applied to the owning player's exact native montage. Remote proxy handoff is immediate and does not guarantee an interpolated blend.
Activity aliases from 0.1.9
Available from 0.1.9. Both the server and observing clients need the matching update.
Use the existing call, for example startAnim(playerId, "fishing", true, 0.15) or startAnim(playerId, "pickcrouch", false, 0.15). See Activity animations and the full Activity animation catalog. Animation-owned rods/tools are cosmetic, not inventory grants; rewards and interaction validation belong to your server script. Acceptance is not a visual acknowledgement.