phase
LateUpdate
phase LateUpdate
LateUpdate runs once per frame, after every Update handler has finished and just before Render. Use it for logic that must observe the settled result of this frame's updates: following the camera to the player's new position, resolving queued despawns, or any end-of-step cleanup that would be wrong to do while other Update handlers are still moving models. The full per-frame order the engine runs is Input → FixedUpdate → Update → LateUpdate → Render, with Start running once at boot before any of them.
Example
program FollowCamera {
property Position { column: int = 0, row: int = 0 }
model Player { Position }
var camera_column: int = 0
handler SpawnPlayer phase Start {
spawn Player { Position { column: 12, row: 0 } }
}
@Queries(these: [Position])
handler MovePlayer phase Update {
Position.column = Position.column + 1
}
# runs after MovePlayer, so the camera sees the final position
@Queries(these: [Position])
handler TrackPlayer phase LateUpdate {
camera_column = Position.column
}
}