A guided tour of spot points
Updated
The arrow keys walk the player along four Spot Points with travel(); each stop is aligned so the player faces what is there to see.
Click the scene, then press the right arrow to go to the next stop and the left arrow to go back. Drag to look around.
A guided tour of spot points
#pragma lifecycle(startup, update)
const STOPS = ['Stop Entrance', 'Stop Sculpture', 'Stop Window', 'Stop Exit'];let points;let current = -1;
function startup() { points = STOPS.map((name) => findEntity(name)?.getComponent(SpotPointComponent));}
function update() { let step = 0; if (Input.keyboard.isKeyReleased(Key.ArrowRight)) step = 1; if (Input.keyboard.isKeyReleased(Key.ArrowLeft)) step = -1; if (step === 0) return;
const next = Math.min(STOPS.length - 1, Math.max(0, current + step)); if (points[next]?.travel()) { current = next; log('Tour stop', current + 1, 'of', STOPS.length); }}How it works
Section titled “How it works”The script is explained step by step in A guided tour of spot points.
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.
GuidedTour.xrproj