Select every lamp
Updated
An #editor_only tool: press Select matching in XR Creator to select every entity whose name contains the word typed in its field, Lamp by default.
Nothing happens in play: this script is a tool. Download the project and press Select matching in XR Creator to select the three lamps.
Select every lamp
#editor_only#pragma slot(ref=word, type=String, default="Lamp", on_validate=checkWord)#pragma slot(ref=run, type=Button, label="Select matching", on_event=onSelect)
function checkWord(value) { return (value != null && value.trim().length > 0) || 'Type part of a name.';}
function onSelect() { const found = []; scene.traverse((object) => { if (isEntity(object) && object.name.includes(word)) found.push(object); }); Editor.select(found); log('Selected', found.length, 'entities matching', word);}How it works
Section titled “How it works”The script is explained step by step in Select every lamp.
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.
SelectLamps.xrproj