Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Play(stateName: string, layer: int = -1, normalizedTime: float = float.NegativeInfinity): void;
void Play(string stateName, int layer = -1, float normalizedTime = float.NegativeInfinity);
def Play(stateName as string, layer as int = -1, normalizedTime as float = float.NegativeInfinity) as void
Play(stateNameHash: int, layer: int = -1, normalizedTime: float = float.NegativeInfinity): void;
void Play(int stateNameHash, int layer = -1, float normalizedTime = float.NegativeInfinity);
def Play(stateNameHash as int, layer as int = -1, normalizedTime as float = float.NegativeInfinity) as void

Parameters

stateNameThe name of the state the will be played.
layerThe layer where the state is.
normalizedTimeThe normalized time at which the state will play.
stateNameHashThe hash of the state.

Description

Plays a state.

This could be used to synchronize your animation with audio or synchronize an Animator over the network.