SplitScript reference / Language / onDetach
onDetach
lifecycle block
onDetach { ... }
Handles closure of a previously attached process.
Runs synchronously once when an attached process closes, after its unusable handle, provider state, selected layout, and pending continuations are cleared. It never runs for the initial detached state; use setup for one-time script initialization. Process and state snapshots are unavailable because closure may happen before initialization finishes.
Examples
Use onDetach
onDetach {
timer.pauseGameTime()
}