UnregisterForDistanceEvents - ScriptObject

Member of: ScriptObject

Unregisters this script from receiving OnDistanceLessThan or OnDistanceGreaterThan events for the two objects.

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

Function UnregisterForDistanceEvents(ScriptObject akObj1, ScriptObject akObj2) native

ParametersEdit

  • akObj1: The first object to check distance with. (Must be an ObjectReference or ReferenceAlias)
  • akObj2: The second object to check distance with. (Must be an ObjectReference or ReferenceAlias)

Return ValueEdit

None

ExamplesEdit

; We no longer care about the distance between the earth and moon
UnregisterForDistanceEvents(Earth, Moon)

NotesEdit

  • The two object parameters are interchangeable.
  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

See AlsoEdit