Difference between revisions of "PlayAnimation - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>MoopusMaximus
(Refined that false statement about permanantly ruining an actor)
imported>Chesko
m
 
(2 intermediate revisions by 2 users not shown)
Line 23: Line 23:


== Notes ==
== Notes ==
PlayAnimation cannot be called on actors. For actors, use [[SendAnimationEvent - Debug|SendAnimationEvent]]. This bypasses the check on [[ObjectReference_Script|ObjectReference]] that prevents sending events to actors. If you use it to send an event to actors, you will may get the actor stuck in the animation. You can un-stick them by using ''PlayIdle("IdleStop_Loose")''.
PlayAnimation cannot be called on actors. For actors, use [[SendAnimationEvent - Debug|SendAnimationEvent]]. This bypasses the check on [[ObjectReference_Script|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)''.


== See Also ==
== See Also ==
*[[ObjectReference Script]]
*[[ObjectReference Script]]
*[[PlayAnimationAndWait - ObjectReference]]
*[[PlayAnimationAndWait - ObjectReference]]

Latest revision as of 10:02, 21 February 2015

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[edit | edit source]

bool Function PlayAnimation(string asAnimation) native

Parameters[edit | edit source]

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

Return Value[edit | edit source]

True if the animation successfully started playing.

Examples[edit | edit source]

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

Notes[edit | edit source]

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).

See Also[edit | edit source]