- Found in:
- Vanilla
voidfunctionUnregisterForDistanceEvents(ScriptObjectakObj1, ScriptObjectakObj2, intaiEventID=-1)Native
Description
Wiki Description
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.
Documentation Comment
Unregister for any distance events between the two objects (which are interchangable)
specify event id to unregister for a specific event, -1 to unregister for all events matching the two objects
Caveats
CK Wiki - Notes
- 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.
Parameters
ScriptObjectakObj1
CK Wiki Description
The first object to check distance with. (Must be an ObjectReference or ReferenceAlias)
ScriptObjectakObj2
CK Wiki Description
The second object to check distance with. (Must be an ObjectReference or ReferenceAlias)
intaiEventID=-1
Examples
; We no longer care about the distance between the earth and moon
UnregisterForDistanceEvents(Earth, Moon)Auto-Generated Example
ScriptObject myScriptObject__akObj1
ScriptObject myScriptObject__akObj2
int myInt__aiEventID
myScriptObject__toCallFunctionOn.UnregisterForDistanceEvents(myScriptObject__akObj1, myScriptObject__akObj2, myInt__aiEventID)Related Pages
Additional References
View this function’s page on the Fallout 4 Creation Kit Wiki
