Difference between revisions of "PlayAnimationAndWait - ObjectReference"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Cdcooley
m (Reverted edits by Scornett-Bot (talk) to last revision by Jlundin)
 
imported>Qazaaq
(animation category)
 
Line 2: Line 2:
[[Category:Papyrus]]
[[Category:Papyrus]]
[[Category:Latent Functions]]
[[Category:Latent Functions]]
[[Category:Animation]]
'''Member of:''' [[ObjectReference Script (Papyrus)]]
'''Member of:''' [[ObjectReference Script (Papyrus)]]



Latest revision as of 17:45, 16 October 2016

Member of: ObjectReference Script (Papyrus)

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.

Syntax[edit | edit source]

bool Function PlayAnimationAndWait(string asAnimation, string asEventName) native

Parameters[edit | edit source]

  • asAnimation: The animation to play. (The name of the event to send to the animation graph)
  • asEventName: The name of the event to wait for.
    • Caution: If the event you send it doesn't exist, the function will never return.

Return Value[edit | edit source]

True if the animation successfully played and finished. If the animation unloads before the end event is received, the function will abort and return false.

Examples[edit | edit source]

; 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

See Also[edit | edit source]