A player card
Updated
A profile card built from a UI Avatar with initials and a status dot, a UI Spacer that pushes the level badge right, and UI Dividers between the stats. Pressing the avatar cycles the status.
Press the avatar to cycle Online, Away and Busy: the status dot and the label change together. Drag outside the panel to orbit the camera, scroll to zoom.
A player card
#pragma lifecycle(startup)
const STATUSES = [ { text: 'Online', color: '#22c55e' }, { text: 'Away', color: '#facc15' }, { text: 'Busy', color: '#ef4444' },];let index = 0;
function startup() { const avatar = findEntity('Avatar').getComponent(UIAvatarComponent); const status = findEntity('Status').getComponent(UILabelComponent);
function show() { const { text, color } = STATUSES[index]; avatar.setProps({ statusColor: color }); status.setProps({ text, color }); log('status:', text); }
on('card:avatar', (event) => { if (event.eventType !== EventType.UIAvatar.Press) return; index = (index + 1) % STATUSES.length; show(); }); show();}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.
PlayerCard.xrproj