Delete - ObjectReference
From Creation Kit
Member of: ObjectReference Script
Flags this object reference as wanting to be deleted. A reference that is flagged for delete will be deleted as soon as:
- It is no longer in a script property
- It is no longer registered for updates
- It is no longer being watched for Anim Events
- It is no longer held in a quest Alias
Only references created in game can actually be deleted.
Function Delete() native
; Deletes the specified reference TempReference.Delete()
- Delete is valid for unique actors only. Please waive from using it on respwning/leveled actors. It will destroy spawn points as you will not delete the spawned actor, but the leveled instance marker. Please use code similar to this to prevent respawn destruction. SetCriticalStage - Actor Source
- Remember that Delete() only flags an object for deletion; the actual deletion takes place later. Per this USKP discussion, if a variable still points to the object, the object will remain temporarily persistent; the deletion won't occur until that variable is cleared (i.e. by setting it to None).