Background for Skyrim SE
Member of the ObjectReference script
boolfunctionPlayAnimationAndWait(stringasAnimation, stringasEventName)Native

Description

Wiki Description

Plays the specified animation on the object and returns when the specified event is hit. (Internally, it sends the named event to the object's animation graph and waits for the named event to be fired) If it succeeds, it returns true. This function is latent.

Documentation Comment

Start the specified animation playing and wait for the specified event - returns true if succeeds


Parameters

  1. stringasAnimation

    CK Wiki Description

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

  2. stringasEventName

    CK Wiki Description

    The name of the event to wait for.

    • Caution: If the event you send it doesn't exist, the function will never return.

Examples

; Play the flip animation and wait for the done event
if Switch.PlayAnimationAndWait("flip", "done")
  Debug.Trace("Flip animation finished playing")
else
  Debug.Trace("Flip animation failed to play or unloaded while playing")
endIf

Auto-Generated Example

string myString__asAnimation
string myString__asEventName

bool returnedValue = myObjectReference__toCallFunctionOn.PlayAnimationAndWait(myString__asAnimation, myString__asEventName)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.