RUSTICDOCSSearch documentation

Lifecycle callbacks

Callbacks are entry points invoked by Rustic. Define only those a behavior needs.

When each callback runs

CallbackWhen to use itVariables
OnCreateOne-time construction before startup.None
StartResolve references and initialize gameplay state.None
OnEnableResume state when the owner becomes enabled.None
FixedUpdatePhysics and deterministic simulation.dt: required fixed-step seconds
UpdateInput, presentation, timers, and per-frame logic.dt: required frame seconds
OnDisablePause state when the owner becomes disabled.None
OnDestroyRelease instance resources before destruction.None
OnStopFinal play-session cleanup.None

Lua 5.4

lua
return { Start=function() end, Update=function(dt) end, FixedUpdate=function(dt) end, OnDestroy=function() end }

JavaScript and HTML / inline JS

javascript
globalThis.behavior={Start(){},Update(dt){},FixedUpdate(dt){},OnDestroy(){}};

External languages

Rustic invokes callbacks through each language SDK. Python calls run(globals()); PHP calls rustic_run(callbacks); C and C++ register RusticBehavior slots; C# calls Run and Java calls run with a callback dispatcher; Luau returns a behavior table. External callback names are on_create, on_start, on_enable, fixed_update, update, on_disable, on_destroy, and on_stop. Omitted callbacks are handled automatically by the SDK; frame callbacks receive dt in seconds. Physics runs after FixedUpdate callbacks, including during Frame Advance. Gravity and solid box response work for built-in primitives, but the simulator does not dispatch collision or touch callbacks to any language.