UnregisterForDistanceEvents - ScriptObject

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

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.

Syntax[edit | edit source]

Function UnregisterForDistanceEvents(ScriptObject akObj1, ScriptObject akObj2) native

Parameters[edit | edit source]

  • 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 Value[edit | edit source]

None

Examples[edit | edit source]

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

Notes[edit | edit source]

  • 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 Also[edit | edit source]