Mask Mesh
Updated
Shows everything under it only through its 2D shape: windows, portals, peepholes, reveals.
- Type
comp-mask-mesh- Script class
MaskMeshComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Masks: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
height |
- |
|
innerRadius |
- |
|
radius |
- |
|
width |
- |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Switch the world behind the portalThree worlds are groups under a circular Mask Mesh with one enabled at a time; Next world closes the portal with a tween, swaps the world and opens it again.
Press Next world to step through the desert, the glacier and space. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(MaskMeshComponent); if (component) log(component.props);}