Background for Skyrim SE
Member of the ObjectReference script

Description

Wiki Description

Event called when this reference's parent cell is detached.

Documentation Comment

Event received when this object's parent cell is detached


Caveats

CK Wiki - Notes

(For notes on the meaning of attachment, see the talk page).

  • If the reference is moved from its current cell to another, an object also leaving this reference's current cell will still trigger this event, while the reference being moved will trigger ObjectReference.OnAttachedToCell(). In other words, these two events can fire at the same time.
  • ObjectReference.GetParentCell() will return the cell that will attach if the reference is being moved from this cell to an attached one. You can also store the parent cell before this event is ran if you want to know what cell is being detached.

Examples

Event OnCellDetach()
  Debug.Trace("Our parent cell has detached")
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends ObjectReference

event OnCellDetach()
    Debug.trace("Event received - OnCellDetach")
endEvent

Related Pages


Additional References

View this event’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.