Seats on spot points
Updated
Three spot points act as seats: clicking a marker travels there and reserves it, and a script counts the occupied and release events they share on one signal.
Click a seat marker to sit there, then another. Watch the script log.
Seats on spot points
#pragma lifecycle(startup)
function startup() { let taken = 0; on('seats', (event) => { if (event.eventType === EventType.SpotPoint.Occupied) taken += 1; if (event.eventType === EventType.SpotPoint.Release) taken -= 1; const seat = findEntity(event.entityId); log(seat?.name, event.eventType === EventType.SpotPoint.Occupied ? 'taken' : 'free', `(${taken} seated)`); });
on('seats/stand', () => { for (const name of ['Seat 1', 'Seat 2', 'Seat 3']) { const seat = findEntity(name)?.getComponent(SpotPointComponent); if (seat?.occupied) seat.release(); } });}How it works
Section titled “How it works”The script is explained step by step in Seats on 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.
SpotPointSeats.xrproj