On this page
Lifecycle event

on_stop

Runs once before the worker stops.

Syntax

Atlas Script
event on_stop() { }

Return value

See the remarks for the returned value and runtime behavior.

Remarks

Runs once before the worker stops. Controller APIs are unavailable here; use it for UI, logging, or other non-controller cleanup. After it returns, Atlas automatically neutralizes controller output, clears rumble and player LEDs, releases lightbar ownership, and clears script overlays.

Examples

Draw text and a status message.atlas
font hud = font.create(1.4, rgb.lime);

event on_frame() {
    ui.print(hud, 0.05, 0.08, string.format("Frame {}", frame));
    ui.status(string.format("Runtime age {} ms", time_ms));
}

event on_stop() {
    ui.clear();
}
Reference details are generated from the Atlas Script schema in this documentation source snapshot. Confirm release-specific behavior in the Atlas for Windows build you use.