Draw your own mouse cursor
Updated
A Cursor component on the camera draws the runtime Lobby demo’s pointer image in place of the system cursor over the view. Clicking the crate switches between the custom and the system cursor.
Move the mouse over the view to see the custom pointer; click the crate to switch to the system cursor and back. Drag to orbit the camera, scroll to zoom.
Draw your own mouse cursor
#pragma lifecycle(startup)
const CUSTOM = '/example-assets/mouse-pointer.png';
function startup() { const cursor = CameraDirector.main.getComponent(CursorComponent); log('Cursor image:', cursor.props.src); on('crate/click', (event) => { if (event.eventType !== EventType.Selectable.Select) return; findEntity(event.entityId)?.getComponent(SelectableComponent)?.setSelected(false); // so the next click selects it again const custom = cursor.props.src !== CUSTOM; cursor.setProps({ src: custom ? CUSTOM : '' }); // empty keeps the system cursor log(custom ? 'Custom cursor' : 'System cursor'); });}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.
CustomCursor.xrproj