Mod:Creation Kit/RegisterForAnimationEvent - ScriptObject

Member of: ScriptObject

Registers this active magic effect/alias/form for the specified animation event on the specified reference.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

Syntax
bool Function RegisterForAnimationEvent(ObjectReference akSender, string asEventName) native

Parameters

 * akSender: The ObjectReference we want animation events from.
 * asEventName: The event we want from the object.

Return Value
Returns True if it was successfully able to register for the event. If false, something went wrong (the animation graph may not be loaded quite yet)

Examples
If (!RegisterForAnimationEvent(self, "reset")) Debug.Trace("Failed to register for event!") EndIf
 * Listen for the "reset" animation event from the object we are attached to