ConstThe game's update ticker instance
const ticker = useCurrentTicker();
useInitialization(() => {
const timeout = ticker.createTimeout(4500); // 4.5 seconds game time
timeout.then(() => {
// cleanup logic or spawn explosion children
isDead.set(true);
});
return () => timeout.cancel(); // important: prevent memory leak on early destroy
});
Returns the shared game ticker — the central update scheduler.
This hook MUST be called at the top level of a component function — never inside loops, conditions, nested functions, or callbacks. The call order of all hooks is strictly fixed across every refresh; reordering calls will corrupt internal state.
Gives direct access to LEA's ticker for creating precise, game-time-aware timeouts, intervals, or one-shot scheduled tasks that respect pause / speed modifiers / fixed timestep.