Lifecycle
Reserved callbacks for persistent scripts.
Syntax
return {
on_load = function() end,
on_world_ready = function() end,
on_world_changing = function() end,
on_tick = function(delta_seconds) end,
on_unload = function(reason) end
}Callbacks
| Callback | Description |
|---|---|
on_load() | Runs after the script returns its table. |
on_world_ready() | Runs when an Unreal world becomes available. |
on_world_changing() | Runs before the active world changes. |
on_tick(delta_seconds) | Runs once per Unreal game-thread tick. |
on_unload(reason) | Runs before the session is disposed. |
Notes
- Every callback is optional.
- A lifecycle error is logged and stops later tick callbacks.
- UObject proxies are weak references; reacquire them in
on_world_readyafter map travel. on_tickuses the standard 2 ms / 50,000-instruction callback budget.