Delete - ObjectReference

From the CreationKit Wiki
Jump to navigation Jump to search

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.

Syntax[edit | edit source]

Function Delete() native

Parameters[edit | edit source]


Return Value[edit | edit source]


Examples[edit | edit source]

; Deletes the specified reference

Notes[edit | edit source]

  • 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).

See Also[edit | edit source]