See teammates through walls, and mark the quest item
Updated
Teammates behind a wall get a Silhouette at startup, so they show through it; the quest item gets a blinking Outline that turns into a rainbow when the camera is within 3 m.
See the three teammates through the wall and the blinking quest item. Scroll in close to the item to turn its outline into a rainbow. Drag to orbit the camera.
See teammates through walls, and mark the quest item
#pragma lifecycle(startup, update)
const TEAMMATES = ['Ally 1', 'Ally 2', 'Ally 3'];const NEAR = 3; // metres
let item;let itemOutline;let near = false;const itemPosition = new THREE.Vector3();const eye = new THREE.Vector3();
function startup() { for (const name of TEAMMATES) { const ally = findEntity(name); if (!ally) continue; if (!ally.getComponent(SilhouetteComponent)) { ally.addComponent(new SilhouetteComponent({ color: '#22d3ee', thickness: 3 })); } }
item = findEntity('Quest Item'); if (!item.getComponent(OutlineComponent)) item.addComponent(new OutlineComponent({})); itemOutline = item.getComponent(OutlineComponent); itemOutline.setProps({ color: '#f97316', animation: 'blink', speed: 0.8 }); itemOutline.setEnabled(true);
on('quest/item-taken', () => itemOutline.setEnabled(false));}
function update() { if (!camera || !itemOutline.enabled) return; camera.getWorldPosition(eye); item.getWorldPosition(itemPosition); const isNear = eye.distanceTo(itemPosition) < NEAR; if (isNear === near) return; near = isNear; itemOutline.setProps(near ? { animation: 'rainbow', speed: 2 } : { animation: 'blink', speed: 0.8 });}How it works
Section titled “How it works”The script is explained step by step in See teammates through walls, and mark the quest item.
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.
TeamVisibility.xrproj