PlayAnimation - ObjectReference
Member of: ObjectReference Script
Starts playing the specified animation on the object and returns immediately. (Internally, it sends the named event to the object's animation graph) If it succeeds, it returns true.
bool Function PlayAnimation(string asAnimation) native
- asAnimation: The animation to play. (The name of the event to send to the animation graph)
True if the animation successfully started playing.
; Play the "flip" animation on the switch Switch.PlayAnimation("flip")
PlayAnimation cannot be called on actors. For actors, use SendAnimationEvent. This bypasses the check on ObjectReference that prevents sending events to actors. If you use it to send an event to actors, you may get the actor stuck in the animation (such as the bleed out animation). You can un-stick them by using PlayIdle(IdleStop_Loose).