Help for the platform
Updated
Three help texts, one per platform: a script reads Device each frame and enables only the keyboard, touch or XR help that fits.
Open the example on a phone to see the touch help instead. The script log names your system.
Help for the platform
#pragma lifecycle(startup, update)
let desktopHelp;let touchHelp;let xrHelp;let wasPresenting = null;
function startup() { desktopHelp = findEntity('Keyboard Help'); touchHelp = findEntity('Touch Help'); xrHelp = findEntity('XR Help');
log(`Running on ${Device.operatingSystem()}, ${Device.isMobile() ? 'mobile' : 'desktop'}`); if (Device.isHeadset()) log('Headset browser detected');}
function update() { const presenting = Device.isXRPresenting(); if (presenting === wasPresenting) return; wasPresenting = presenting;
xrHelp.setEnabled(presenting); touchHelp.setEnabled(!presenting && Device.isTouch()); desktopHelp.setEnabled(!presenting && !Device.isTouch());}How it works
Section titled “How it works”The script is explained step by step in Help for the platform.
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.
PlatformHelp.xrproj