Open a portal
Updated
An elliptical portal pops open over a second and then gently breathes, showing a glowing world that exists only inside it: a Mask Mesh resized by tweens from a Behavior script.
Watch the portal open, then orbit to see the world behind it is clipped to the ellipse. Drag to orbit the camera, scroll to zoom.
Open a portal
#pragma lifecycle(startup)
async function startup() { const mask = findEntity('Portal').getComponent(MaskMeshComponent); mask.setProps({ shape: 'ellipse', width: 0.01, height: 0.01 });
const finished = await Tween.value(0, 1, (t) => { mask.setProps({ width: 0.01 + t * 2.4, height: 0.01 + t * 3.2 }); }, { duration: 1, ease: Ease.OutBack }); if (!finished) return;
Tween.value(0, 1, (t) => { mask.setProps({ width: 2.4 + t * 0.08, height: 3.2 + t * 0.1 }); }, { duration: 1.6, ease: Ease.InOutSine, repeat: Infinity, yoyo: true });}How it works
Section titled “How it works”The script is explained step by step in Open a portal.
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.
PortalOpen.xrproj