DeleteWhenAble - ObjectReference
From Creation Kit
Member of: ObjectReference Script
Waits for this reference to lose its parent cell, or for its parent cell to become detached, then deletes it.
Function DeleteWhenAble() While GetParentCell() && GetParentCell().IsAttached() Utility.Wait(5) EndWhile Delete() EndFunction
; Deletes the specified reference when its parent cell is gone TempReference.DeleteWhenAble()
- Using DeleteWhenAble() within a scene can cause it to stall. ( This needs independent verification. My assumption is that the scene is waiting for the operation to complete. )