Seek or arrive
Updated
Six agents chase a beacon that jumps every five seconds: three with a Steering Seek rush at full speed, three with a Steering Arrive slow down within 3 m and report each stop.
Watch the blue seekers overshoot and brake hard while the green arrivers ease in; the label counts the Arrive stops. Drag to orbit the camera, scroll to zoom.
Seek or arrive
#pragma lifecycle(startup)
const SPOTS = [[-3, -2], [3, -1.5], [2.2, 2.4], [-2.6, 2]];let spot = 0;let arrivals = 0;
function startup() { const beacon = findEntity('Beacon'); const label = findEntity('Arrivals').getComponent(UILabelComponent);
function move() { spot = (spot + 1) % SPOTS.length; const [x, z] = SPOTS[spot]; Tween.to(beacon.position, { x, z }, { duration: 0.5 }); delay(move, 5000); } delay(move, 3000);
// Arrive reports each stop; Seek never does. on('arrivals', (event) => { if (event.eventType !== EventType.SteeringAgent.Arrive) return; arrivals += 1; label.setProps({ text: `Arrive stops: ${arrivals}` }); log(findEntity(event.entityId).name, 'arrived'); });}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.
SeekAndArrive.xrproj