PlayAnimation - ObjectReference

Revision as of 19:30, 19 February 2012 by imported>Cipscis (→‎Notes: Corrected terminology, made capitalisation consistent with the rest of the wiki, beautified link and copied relevant note from SendAnimationEvent)

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.

Syntax

bool Function PlayAnimation(string asAnimation) native

Parameters

  • asAnimation: The animation to play. (The name of the event to send to the animation graph)

Return Value

True if the animation successfully started playing.

Examples

; Play the "flip" animation on the switch
Switch.PlayAnimation("flip")

Notes

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 will most likely mess up the actor permanently as the internal actor data may no longer match their animation state.

See Also