A scoreboard
Updated
A Text entity shows a score that goes up on every point signal and resets on round/start.
Press Point to score, and New round to reset. Drag to orbit the camera, scroll to zoom.
A scoreboard
#pragma lifecycle(startup)
let score = 0;let label;
function render() { label.setProps({ text: `Score: ${score}` });}
function startup() { label = findEntity('Score').getComponent(TextComponent); label.setProps({ fontSize: 0.4, font: 'montserrat', fontWeight: 'bold', outlineWidth: '6%' }); render();
on('point', () => { score++; render(); });
on('round/start', () => { score = 0; render(); });}How it works
Section titled “How it works”The script is explained step by step in A scoreboard.
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.
ScoreboardText.xrproj