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.

SyntaxEdit

bool Function RegisterForAnimationEvent(ObjectReference akSender, string asEventName) native

ParametersEdit

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

Return ValueEdit

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)

ExamplesEdit

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

NotesEdit

  • The reference in question must have loaded 3D, otherwise this function will fail
  • Aliases and quests will automatically unregister for this event when the quest stops.
  • Active magic effects will automatically unregister when they are removed.
  • Animation events are always unregistered when the target animation graph unloads. Anything registered will automaticallly get the OnAnimationEventUnregistered event when this happens.

See AlsoEdit