Slow motion and pause
Updated
A power-up sets Time.scale to 0.3 for 1.5 seconds, slowing everything driven by game time, and Escape pauses and resumes the game.
Press Slow motion to slow the balls for a moment. Click the scene and press Escape to pause, and again to resume.
Slow motion and pause
#pragma lifecycle(startup, update)
let cancelSlowMo;
function startup() { on('powerup/slow-motion', () => { cancelSlowMo?.(); Time.scale = 0.3; cancelSlowMo = delay(() => (Time.scale = 1), 1500); });}
function update() { if (!Input.keyboard.isKeyReleased(Key.Escape)) return; if (Time.isPaused()) { Time.resume(); log('Resumed'); } else { Time.pause(); log('Paused'); }}How it works
Section titled “How it works”The script is explained step by step in Slow motion and pause.
Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
TimeControl.xrproj