Examples
Updated
Each example is a small project running on the MIRA runtime in your browser. Open one, press Run example, read its Behavior scripts next to it, and download it as an .xrproj project to open in XR Creator.
Basic principles
Section titled “Basic principles”Three tweens from one script: a ball that bobs for ever, a box that turns and waits, and a shape that pulses when you click it, awaiting each step.
Click the diamond on the right to make it pulse. Drag to orbit the camera, scroll to zoom.
Hold F to fire glowing bullets from a turret: an ObjectPool reuses the bullet meshes and throttle limits the rate of fire.
Click the scene, then hold F to fire. Drag to orbit the camera, scroll to zoom.
A point light switched on and off every half second by a script that schedules itself with delay instead of setInterval.
Watch the lamp blink. Drag to orbit the camera, scroll to zoom.
A pickup that floats up and down for ever: one Tween with repeat: Infinity, yoyo and an InOutSine ease.
Watch the pickup float. Drag to orbit the camera, scroll to zoom.
Box2D, the 2D physics engine compiled to JavaScript, imported from a CDN, drops six boxes on a ground seen through an Orthographic Camera, and a click kicks a box up: the script steps the Box2D world every frame and copies each body's position and angle to its box.
Watch the boxes fall and stack. Click a box to kick it up, or click the scene and press Space to drop them all again.
A script builds a PointLightEntity and a PrimitiveMeshEntity from their classes, configures their components and adds them to the scene.
Look for the yellow marker above the table. Drag to orbit the camera, scroll to zoom.
Two scripts that never reference each other: one emits coin:collected when C is pressed, the other keeps the score and announces level:complete.
Click the scene, then press C and watch the score in the script log.
A coin that spins until it is clicked, then announces score/add, shrinks with an awaited Tween and destroys itself.
Click the coin to collect it. Drag to orbit the camera, scroll to zoom.
canvas-confetti, imported from a CDN, draws on a canvas the script made, shown on a plane kept in front of the camera so the burst covers the view.
Click the scene, then press Space to fire confetti from a random spot. Drag to orbit the camera, scroll to zoom.
A script finds the entity named Door once, then swings it open with setRotation when O is pressed and shut when C is pressed.
Click the scene, then press O to open the door and C to close it. Drag to orbit the camera, scroll to zoom.
One script exports a scoreboard object of functions that updates a UI Label; another imports it and adds points each time a gem is clicked.
Click the gem to score. Drag to orbit the camera, scroll to zoom.
Faker, imported from a CDN, gives three visitors a name and a job. A fixed seed makes the names the same on every run, and R moves to the next seed.
Press R for new names. Drag to orbit the camera, scroll to zoom.
Your first script: a Behavior under a sphere bobs it around its starting height, with the height and period as editor slots.
Watch the ball bob. Drag to orbit the camera, scroll to zoom.
d3-force, imported from a CDN, lays out six linked balls: the simulation is ticked once a frame and its positions move the balls and the lines between them.
Watch the graph settle, then press Space to scatter it. Drag to orbit the camera, scroll to zoom.
OpenCV.js, imported from a CDN, finds the edges in a picture drawn on a script canvas with Canny edge detection, and two planes show the picture and its edges side by side.
OpenCV.js is an 11 MB download (2.8 MB compressed): wait a few seconds for the edges to appear. Then click the scene and press Space to try other thresholds. Drag to orbit the camera, scroll to zoom.
A moon circling a planet, placed every frame from #define constants and the predefined M_TAU.
Watch the moon circle the planet. Drag to orbit the camera, scroll to zoom.
An arm that swings from the total playing time passed to update, so it never drifts however irregular the frames are.
Watch the pendulum swing. Drag to orbit the camera, scroll to zoom.
Two endless tweens bob and spin a pickup; on pickup/taken they stop, a third shrinks it away, and the pickup is destroyed.
Watch the gem bob and spin, then press Take to make it pop and vanish. Drag to orbit the camera, scroll to zoom.
A box that grows and settles back with a bounce when clicked: two awaited Tweens on its scale, started from a Selectable event.
Click the box. Drag to orbit the camera, scroll to zoom.
One script serves every crate: it adds an Outline component to the crate that is selected and removes it when the crate is deselected.
Click a crate, then another. Drag to orbit the camera, scroll to zoom.
A power-up sets Time.scale to 0.3 for 1.5 seconds, slowing everything driven by game time, and Escape pauses and resumes the game.
Press Slow motion to slow the balls for a moment. Click the scene and press Escape to pause, and again to resume.
A top that spins at the speed of a Slider slot, in the direction of a Boolean slot: two editor fields the script reads as variables.
Watch the top spin. Download the project to change Speed and Clockwise in XR Creator.
A script finds the entity named Lamp and makes its Point Light brighter and warmer with setProps.
Open the script log to read the new intensity. Drag to orbit the camera, scroll to zoom.
At startup a script gives every Selectable two filtered Signal Emitters, a disabled Outline and two Enable on Signal components, so selecting an object outlines it with no more code.
Click the shapes: the selected one is outlined. Drag to orbit the camera, scroll to zoom.
Editor
Section titled “Editor”An #editor_only tool: select an entity in XR Creator and press Measure selection to log how far it is from the viewport camera.
Nothing happens in play: this script is a tool. Download the project, select a pillar in XR Creator and press Measure selection.
A turntable spins at the speed of a Slider slot; in XR Creator, a validator rejects a speed of 0 and a Reset speed button sets it back to 4.
Watch the turntable spin. Download the project, set Speed to 0 and press Reset speed in XR Creator.
An #editor_only tool script: select some crates in XR Creator and press Line up selection to set them in a row along x, Spacing apart.
Nothing moves in play: this script is a tool. Download the project, select the crates in XR Creator and press Line up selection.
An #editor_only level-design tool: select the trees in XR Creator and press Scatter selection to spread and turn them on a disc, repeatably from a seed.
Nothing moves in play: this script is a tool. Download the project, select the trees in XR Creator and press Scatter selection, then Gather at origin.
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.
Play code spins a windmill in play; an editor region adds a Reset rotation button that runs only in XR Creator and never ships to the player.
Watch the sails turn in play. Download the project and press Reset rotation in XR Creator to run the editor code.
A sign sways with the Wind slot in play; in XR Creator, a Calm or Storm preset sets the wind field's range, value and label.
Watch the sign sway gently. Download the project and pick Storm in the Preset menu in XR Creator to see the Wind field change.
Scenes
Section titled “Scenes”Your first scene switch: clicking a box in level-1 looks up the scene named level-2 with Scenes.list() and loads it with Scenes.load.
Click the box to load level-2. Drag to orbit the camera, scroll to zoom.
A two-scene project: clicking the portal looks up the scene named level-2 with Scenes.list() and loads it with Scenes.load.
Click the ring to travel to level 2. Drag to orbit the camera, scroll to zoom.
A three-scene project whose script logs every scene from Scenes.list() and marks the active, ruling one from Scenes.active().
Read the scene list in the script log.
Components
Section titled “Components”An amber companion orb has a Don't Unload component, so when you click a door and the project switches between the meadow and the cave scene, the orb, and the script on it, move with you while everything else is replaced.
Click the blue door to go to the cave, then the green door to come back: the orb stays with you and keeps counting the trips. Drag to orbit the camera, scroll to zoom.
A script adds a disabled Outline to a crate once, then switches it on and off from the Selectable hover and leave events.
Move the pointer over the crate. Drag to orbit the camera, scroll to zoom.
The floor-standing scenery is locked with Lock components, so in the editor it cannot be picked or moved by mistake, while scripts still move it. Clicking the crate locks or unlocks it and the Lock::change event reports it.
Read the log for the locked entities, then click the crate to lock or unlock it. The pillar is locked but the script still turns it. Download the project to see the locks in XR Creator. Drag to orbit the camera, scroll to zoom.
A script spawns four bricks under the Pile group, then calls recenter() on its Group component, so the pile spins around the middle of its bricks instead of its old origin.
Watch the bricks turn around their own centre; the log says how many entities recenter() moved. Drag to orbit the camera, scroll to zoom.
A script adds a filtered Signal Emitter to a crate, then moves it twice: setPosition reports a Transform event, a direct write to position does not.
Read the script log: one line for the setPosition call, none for the direct write.
Layers
Section titled “Layers”The H key shows or hides every decoration: the script finds the entities whose Layer component is 6 and switches them with setEnabled.
Click the scene, then press H to hide and show the flowers. Drag to orbit the camera, scroll to zoom.
Hold Space to charge and release to throw a ball: the keyboard state sets the strength of an impulse on its Rigid Body.
Click the scene, then hold Space and release it to throw the ball. Drag to orbit the camera, scroll to zoom.
Your first input script: the arrow keys or WASD move a box, multiplied by dt so the speed is the same at any frame rate, and Space makes it hop.
Click the view so it has the keyboard focus, then use the arrow keys or WASD, and Space to hop.
Input.camera starts the front camera and its live texture is shown, flipped like a mirror, on a plane added to a frame.
Allow the camera when the browser asks, then wave at the mirror. Needs a camera and your permission. Drag to orbit the camera, scroll to zoom.
A script reads Input.keyboard every frame: W and S walk the figure along the way it faces, A and D turn it, and Shift doubles the speed.
Click the scene, then hold W or S to walk, A or D to turn, and Shift to run. Drag to orbit the camera, scroll to zoom.
The camera's Screen Gamepad shows a D-pad and an A button; a script moves through a menu on presses of 1 and 3 and chooses with A.
Press the 1 and 3 buttons of the on-screen pad to move through the menu.
A script reads the Screen Gamepad on the main camera and keeps only two sticks, A and X, recoloured green.
Watch the on-screen pad: the scene starts with only the sticks, A and X, in green. Drag to orbit the camera, scroll to zoom.
Three help texts, one per platform: a script reads Device each frame and enables only the keyboard, touch or XR help that fits.
Open the example on a phone to see the touch help instead. The script log names your system.
A board tilts with the phone through Input.accelerometer; on a desktop, where no reading arrives, the arrow keys tilt it instead.
On a desktop, click the scene and hold the arrow keys. On a phone, press Motion, allow motion access, and tilt the phone. Drag to orbit the camera, scroll to zoom.
A sphere grows with the loudness of your voice: a microphone toggle button starts and stops Input.microphone, a label says what it is doing, and the script eases the sphere towards level() every frame.
Press the microphone button and allow the microphone, then speak or clap. Press it again to stop. Needs a microphone and your permission. Drag to orbit the camera, scroll to zoom.
A speaker cone grows with the loudness of your voice: the script starts Input.microphone at startup and eases the cone towards level() every frame.
Allow the microphone when the browser asks, then speak or clap. Needs a microphone and your permission. Drag to orbit the camera, scroll to zoom.
The mouse wheel scales a model between half and three times its size, read with Input.mouse.wheelDelta(); a right click puts it back to its own size.
Turn the mouse wheel over the scene to grow or shrink the model, then right-click to reset it. Drag to orbit the camera.
A rover drives with the right XR controller's thumbstick and speeds up with its trigger; outside a headset, where the controller reads as disconnected, the arrow keys and Shift drive it.
Click the scene and drive the rover with the arrow keys; hold Shift to go faster. In a headset, use the right thumbstick and trigger. Drag to orbit the camera, scroll to zoom.
Interaction
Section titled “Interaction”A Selectable that reports clicks and hovers, and a Grabbable you can drag with a mouse, a touch screen or an XR controller. A script listens to both on the event bus.
Hover and click the round shape on the left, then drag the box on the right. Drag to orbit the camera, scroll to zoom.
Grabbable crates with dynamic bodies on a small platform: one script logs each pickup and puts back any crate that falls off the edge.
Drag a crate off the platform and let it fall. Scroll to zoom.
A script configures a door hinge's Handle to turn the pointer's sweep into a clamped rotation, and reports how far the door is open when you let go.
Drag the door to swing it open, then let go. Scroll to zoom.
While the left button is held, CoordinateSpace.screenToWorld puts a lantern under the pointer, always three metres from the camera.
Hold the left mouse button and move the pointer: the lantern follows it, three metres away. Scroll to zoom.
A Handle lets a drawer slide only along Z between two limits; while it is dragged, a script reads its position and signals when it passes halfway, which lights a lamp through an Enable On Signal.
Drag the drawer out past halfway to light the green lamp, then push it back in. Drag elsewhere to orbit the camera, scroll to zoom.
An invisible Snap Zone wears a backdrop of its own: a one-by-one plane the script scales to the zone's size at startup and on every SnapZone::resize, as items fill the grid.
Drag the pictures onto the backdrop: it grows as the grid fills, and shrinks when you take them off. Drag elsewhere to orbit the camera, scroll to zoom.
A label counts the pictures on a Snap Zone: it reads the zone's contents and capacity at startup and after every SnapZone::change.
Drag the pictures onto the frame, and off again: the label counts them. Drag elsewhere to orbit the camera, scroll to zoom.
Click the chair to show its Pivotable gizmo and drag the arrows or rings to move it; T, R and S switch between moving on the floor, turning and scaling, and L between local and world axes.
Click the chair, drag its gizmo, then press T, R, S or L to change what the gizmo does. The arrow keys and WASD do not move the camera here. Drag the background to orbit, scroll to zoom.
Every frame a physics ray runs from the guard’s eyes to the player’s; when nothing blocks it the guard is alerted, and an Enable On Signal shows the alarm above its head.
Drag the blue player out from behind the wall: the pink alarm lights while the guard can see it. Drag elsewhere to orbit the camera, scroll to zoom.
Three exhibits share one signal: hovering one enables its Outline, leaving removes it unless the exhibit is selected, and deselecting clears it.
Hover over an exhibit to outline it; click one to keep it outlined, then click empty space to clear it. Drag to orbit the camera, scroll to zoom.
A lamp's Selectable switches its bulb: one listener on Selectable::change enables the bulb, with its light, while the lamp is selected.
The lamp starts on. Click empty space to switch it off, and click the lamp to switch it on again. Drag to orbit the camera, scroll to zoom.
When the puzzle is solved, a script snaps a door shut and locks every axis of its Handle; resetting the puzzle restores the Handle's props.
Drag the door to swing it, then press Solve puzzle: it snaps shut and no longer moves. Press Reset puzzle to unlock it. Scroll to zoom.
Each click spawns a bullet at the gun's muzzle and pushes it along the barrel: CoordinateSpace.localToWorld turns points in the gun's own space into world points.
Click anywhere in the view to fire. Drag to orbit the camera, scroll to zoom.
Each click casts a GraphicsRaycaster ray from the mouse, ignores the marker itself, and moves the marker to the hit point.
Click the shapes or the floor. Drag to orbit the camera, scroll to zoom.
A click or a tap casts a ray from the camera: the flag is placed where it meets the hill, or on the level ground when it misses the hill.
Click or tap the hill or the floor to plant the flag there. Drag to orbit the camera, scroll to zoom.
A Handle with every axis locked still reports press and release: the cap sinks with a tween, springs back, and the release toggles a lamp through an Enable On Signal.
Press and release the button to switch the lamp on and off. Drag elsewhere to orbit the camera, scroll to zoom.
A video clip with a Snappable plays when it snaps onto a Snap Zone and pauses when it is taken off, from its own Snappable events.
Drag the clip onto the frame to play it, and off again to pause it. Drag elsewhere to orbit the camera, scroll to zoom.
Two Snap Zones that take every swatch, and a script that counts on each change how many swatches sit in the zone their name matches.
Drag the warm swatches into the left frame and the cool ones into the right. Scroll to zoom.
A script sets a knob's Handle to turn only about Y, within about 275 degrees, and maps the angle to a volume from 0 to 1 when it is let go.
Drag across the knob to turn it, then let go: the volume is sent on audio/volume. Drag elsewhere to orbit the camera, scroll to zoom.
Meshes
Section titled “Meshes”A box that spins every frame and takes a new colour when you click it: a Behavior script, a Selectable and a Signal Emitter.
Click the box. Drag to orbit the camera, scroll to zoom.
A beacon that flashes its emissive glow on and off twice a second: a Behavior script changing a Standard Material from a timer.
Watch the beacon flash. Drag to orbit the camera, scroll to zoom.
A script scatters 500 copies of a disabled tree template with random turns and sizes, and the Cache Mesh on each part draws all of them in one draw call per part.
Look around the forest; it is the same forest on every reload. Drag to orbit the camera, scroll to zoom.
An animated Collada (.dae) character on a turntable, with its texture beside the file: the script centres it, scales it to 1.4 m and plays the first clip stored in the file.
Watch the character turn on the turntable while it plays its clip; the log lists the clips. Drag to orbit the camera, scroll to zoom.
Four times a second, a script hides every member of a crowd farther than 40 m from the camera, and shows them again as the camera comes closer.
Scroll in and out: people farther than 40 m from the camera disappear, and come back as you approach. Drag to orbit the camera.
A tween pushes a sphere tool through a block and back; the CSG re-cuts on every move, so the hollow travels along the block.
Watch the scoop travel through the block and back once. Drag to orbit the camera, scroll to zoom.
A wall holds a box tool whose CSG is saved disabled; clicking the switch enables and disables the CSG, opening and sealing the doorway.
Click the blue switch to open the doorway, and again to seal it. Drag to orbit the camera, scroll to zoom.
Each press of H spawns a copy of a disabled cylinder tool, with a CSG set to subtract, under a panel at a random spot: every copy drills a new hole.
Click the scene, then press H to drill a hole; the panel takes up to twelve. Drag to orbit the camera, scroll to zoom.
A block and a sphere tool give three solids: each press of Next operation switches the CSG between subtract, union and intersect.
Press Next operation to cycle subtract, union and intersect. Drag to orbit the camera, scroll to zoom.
A script adds a fading Outline to three levers and enables one at a time; each press of Tab moves the highlight to the next lever.
Click the scene, then press Tab to move the highlight to the next lever. Drag to orbit the camera, scroll to zoom.
A script registers a custom dissolve preset, gives the crate a Shader Material with it, and tweens its progress uniform from 0 to 1 on crate/destroy before destroying the crate.
Press Destroy to burn the crate away along a blocky pattern. Drag to orbit the camera, scroll to zoom.
A script opens a sphere into a dome over one second, rebuilding its Geometry's thetaLength in eight steps.
Watch the dome open when the scene starts. Drag to orbit the camera, scroll to zoom.
An animated FBX (.fbx) cube on a turntable, drawn with an amber Standard material that overrides its own: the script sizes it to 0.6 m and plays the animation clip stored in the file.
Watch the cube play the rotation clip from its FBX file; the log names the clip. Drag to orbit the camera, scroll to zoom.
Your first graphics script: a box becomes a glowing amber crystal through its Geometry and material props, and each click swaps its Standard material for the hologram Shader Material preset and back.
Click the crystal to switch between the glowing material and the hologram. Drag to orbit the camera, scroll to zoom.
On knight/freeze, a disabled Shader Material draws the frozen preset on this one model with setTransientModelPreset, and three seconds later restores the model's own look.
Press Freeze to cover the knight in ice for three seconds. Drag to orbit the camera, scroll to zoom.
A glass cube and a glass ring from the runtime's Glass Lake demo, under an outdoor sky: what stands behind shows through their tint, and the cube steps through clear, sea and amber tints.
Orbit around the glass to see the objects behind it through the tint and the sky reflected at grazing angles. Drag to orbit the camera, scroll to zoom.
Balls roll down a meadow and part the grass with their Grass Benders, as in the runtime Sky & Terrain demo; the script gives the camera a bender of its own and makes the wind gust every few seconds.
Watch the balls roll down the hill and push the grass aside, and the meadow sway harder when a gust comes. Drag to orbit the camera, scroll to zoom.
Drag a mower across a lawn and it cuts a strip through the grass, saving the mowed area to the grass mask a second after it stops: a Grass component painted by a Behavior script.
Drag the amber mower over the grass, then let go: "Lawn saved" appears in the log. Drag the background to orbit the camera, scroll to zoom.
On enemy/hit, a script adds a red Basic Material to a loaded model for 120 ms, then removes it, which restores the model's own materials.
Press Hit to make the knight flash red. Drag to orbit the camera, scroll to zoom.
A statue turns into a hologram when the scene starts, and the log lists every built-in shader preset: a Shader Material added by a Behavior script with the hologram preset.
Read the list of presets in the log. Drag to orbit the camera, scroll to zoom.
A custom shader reads the pointer and time inputs by itself: the button pulses while the pointer is over it and flashes when pressed, with no script work per frame.
Move the pointer over the button to make it pulse, and press on it to flash it. Drag elsewhere to orbit the camera, scroll to zoom.
A chest shows an outline while the pointer is over it: a Selectable forwarding hover and leave through a Signal Emitter, and a Behavior script switching an Outline on and off.
Move the pointer over the chest and away again. Drag to orbit the camera, scroll to zoom.
A small shrine assembled from one modular kit file: floor tiles, pillars, walls, a beam and steps are each a Kit Piece that loads only the part named by its pieceId. The script counts the pieces as they load.
Orbit around the shrine: every part comes from the same kit file. The log counts the pieces as they load. Drag to orbit the camera, scroll to zoom.
A lantern made with Lambert materials, the cheap matte kind for phones and headsets: clicking it switches its emissive glow and a point light inside it on and off.
Click the lantern to light it, click again to put it out. Drag to orbit the camera, scroll to zoom.
A ball rolls in circles over a meadow terrain and paints a trail of the terrain's own Terrain Textures under it, switching between the two images each lap: the textures of the runtime Sky & Terrain demo.
Watch the trail of images appear behind the ball, a different image each lap. Drag to orbit the camera, scroll to zoom.
A grove of trees with three levels of detail each: amber and detailed near, blue and coarse further out, a violet cone far away. The script logs every switch of the first tree with the camera's distance.
Scroll to zoom out and in, and watch the trees swap levels and the log report each switch of the front tree. Drag to orbit the camera.
The floor of the runtime's Dynamic Bones demo: a Reflector material that mirrors the shapes bobbing over it, fading their reflection with height. The script raises and lowers the reflection strength.
Watch the shapes bob over their reflections, and the floor turn from satin to mirror and back. Drag to orbit the camera, scroll to zoom.
Shapes coloured by the direction each surface faces, with a Normal material that needs no light; every three seconds the script switches them between smooth and flat shading.
Watch the colours follow each face as the shapes turn, and the switch between smooth and faceted shading. Drag to orbit the camera, scroll to zoom.
A low-poly tree loaded from a Wavefront OBJ (.obj) file, which carries geometry only, so an amber Standard material colours it. The script centres it and scales it to 1.6 m.
Watch the tree turn on the turntable. Drag to orbit the camera, scroll to zoom.
A toy car under an outdoor sky changes its paint between gloss, metallic, matte and pearl: four Physical material looks, each applied with one setProps, from buttons that send the paint/finish signal.
Press Gloss, Metallic, Matte or Pearl and watch the clear coat, metal and iridescence change under the sky. Drag to orbit the camera, scroll to zoom.
Three Phong spheres, from dull to polished, and a ring that steps through the same shininess values every two seconds: the highlight tightens as `shininess` rises.
Watch the highlight on the ring sharpen and spread as it steps through the shininess values. Drag to orbit the camera, scroll to zoom.
A script copies a disabled Primitive Mesh template into a ring of twelve pillars, each with its own height and colour: spawn, the Geometry component and the material.
Reload the example for a new set of heights and colours. Drag to orbit the camera, scroll to zoom.
Each click on the crate writes the next colour of a palette into its material's color prop.
Click the crate to change its colour. Drag to orbit the camera, scroll to zoom.
One tween changes wave height, foam and rain together on four ocean tiles, turning a calm sea into a storm and back.
Press Storm to raise the waves over twelve seconds, and Calm to let them settle. Drag to orbit the camera, scroll to zoom.
A crate is outlined in a calm style while it is selected, and in a bright sweeping style while it is grabbed, from one listener on all its events.
Click the crate to outline it, drag it to see the held style, and click empty space to clear it. Drag elsewhere to orbit the camera.
A custom Shader Material declares a Texture uniform, and a Shader Texture on the same entity feeds it an image: the print scrolls around an amber drum, and the script swaps the image every few seconds without rebuilding the shader.
Watch the print scroll around the drum and change image every three seconds. Drag to orbit the camera, scroll to zoom.
A balloon floats over a day sky with no visible floor: a Matte Shadow material catches only its shadow, so it still reads as standing on the ground. The script bobs it so the shadow grows and shrinks.
Watch the shadow on the invisible ground follow the balloon. Drag to orbit the camera, scroll to zoom.
Amelia walks back and forth behind a wall; her Silhouette, in the runtime Outlines & Silhouettes demo's cyan, shows her outline wherever the wall hides her.
Watch the cyan outline follow Amelia while she is behind the wall. Drag to orbit the camera, scroll to zoom.
A sphere tool under a box slides from side to side and carves a moving dent: a CSG component set to subtract, moved by a Behavior script every frame.
Watch the dent travel along the front of the block. Drag to orbit the camera, scroll to zoom.
Two trees, a rock and a signpost saved floating above a hilly terrain drop onto its surface at startup: a Terrain component read with heightAt by a Behavior script, with no raycast.
Orbit around: every object rests on the slope under it. Drag to orbit the camera, scroll to zoom.
Two Splat Meshes share a place; each press of Space cross-fades their opacity with a tween, from one capture to the other.
Click the scene, then press Space to cross-fade between the two captures. Drag to orbit the camera, scroll to zoom.
On sky/dusk, a tween blends a Splat Mesh's color from white to a warm dusk tint over six seconds.
Press Dusk to warm the capture over six seconds. Drag to orbit the camera, scroll to zoom.
A Gaussian splat capture stays invisible while it downloads and decodes, then fades in over two seconds: a Behavior script waits on whenDrawn and tweens the Splat Mesh opacity.
Wait for the capture to download (about 12 MB) and watch it fade in. Drag to orbit the camera, scroll to zoom.
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.
Holding R, F or G sculpts the terrain under the mouse every frame with sculptAt, raising, lowering or smoothing it; releasing the key commits the change.
Point at the ground and hold R to raise it, F to lower it or G to smooth it. Drag to orbit the camera, scroll to zoom.
Every quarter of a second, a script paints a soft disc of the terrain's first texture under the camera with paintAt, leaving a trail wherever the camera goes.
Drag to orbit the camera, or move it with WASD: a trail is painted on the ground beneath it. Scroll to zoom.
A script registers a toon preset whose ramp maps light to three hard bands, and gives it to three characters.
Orbit around the three characters to see the light fall in three flat bands. Drag to orbit the camera, scroll to zoom.
The lights dim and come back every few seconds: the Standard sphere darkens with them, while the Basic material sphere keeps its full colour, because a Basic material is never lit.
Watch the left sphere darken with the lights while the Basic sphere on the right stays bright. Drag to orbit the camera, scroll to zoom.
A textured USDZ (.usdz) model, the format of AR Quick Look, on a turntable: the script centres it and scales it to 0.8 m once it loads.
The file is about 4 MB, so give it a moment, then watch it turn. Drag to orbit the camera, scroll to zoom.
Each click on the orb applies the next variant of its Holo Foil preset, writing the variant's values into the props and uniforms.
Click the orb to step through the variants of its shader. Drag to orbit the camera, scroll to zoom.
A garden pool of clear water: caustic light dances on its tiled floor, the walls are wet at the waterline, a beach ball bobs with foam round it, and a Water Volume lets the camera go under the surface.
Drag to orbit round the pool. Scroll in to dive under the surface: the water fogs the view, bubbles drift past and caustics play on the floor. Scroll out to come back up.
Effects
Section titled “Effects”Click the wood pile and a campfire flares up with a point light glowing above it: a Fire entity saved disabled, a Selectable with a Signal Emitter, and a Behavior script that grows the flames and the light in together.
Click the wood pile to light the fire. Drag to orbit the camera, scroll to zoom.
A campfire loses fuel every second and shrinks with it, throttled to four prop changes a second; Add wood feeds it, and an empty fire switches off until fed again.
Watch the fire shrink, then press Add wood to feed it; let it run out and it goes dark until you add more. Drag to orbit the camera, scroll to zoom.
A Decal limited to the alley wall, so it never paints the plants in front, fades in with a tween when the mural is revealed.
Press Reveal the mural to fade the picture in on the wall. Drag to orbit the camera, scroll to zoom.
Clicking the portal's frame flips its Mask Mesh's invert: a window that shows another world inside the ellipse becomes a hole that shows it everywhere else.
Click the blue frame to turn the window into a hole, and again to turn it back. Drag elsewhere to orbit the camera, scroll to zoom.
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.
Three 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.
A Decal on a sign board changes its src every five seconds; it loads each new image and restamps it.
Watch the sign change picture every five seconds. Drag to orbit the camera, scroll to zoom.
A dynamic decal projects a logo down onto a platform that slides back and forth under it, tinting it orange while the platform moves fast: a Decal component driven by a Behavior script.
Watch the logo slide across the moving platform and turn orange at speed. Drag to orbit the camera, scroll to zoom.
Each click on the floor copies a disabled template Decal with spawn, turned to project straight down, at a random angle and opacity; past twenty marks the oldest is destroyed.
Click the floor to leave marks. Drag to orbit the camera, scroll to zoom.
A button in the world plays and pauses a Video screen, and a Text sign follows its ready, play, pause and end events.
Click the amber button to play the film, and again to pause it. Drag elsewhere to orbit the camera, scroll to zoom.
A small gallery whose pieces carry Attribution components: at start the script reads each title and author and writes them on a credits sign, with "Unknown artist" where no author is set.
Read the credits sign on the right: it was written from the pieces' Attributions. Drag to orbit the camera, scroll to zoom.
A presenter's screen shows a PDF slide deck; the left and right arrow keys turn its pages, stopping at the first and last, with the page count read from the PDF::ready event.
Click the view, then press the right and left arrow keys to turn the pages. The arrow keys do not move the camera here; drag to orbit, scroll to zoom.
A picture frame holds each slide for four seconds, fades it out, swaps the file, waits for the new image's ready event and fades back in, all from an async loop on the Image entity.
Watch the frame fade from one picture to the next every few seconds. Drag to orbit the camera, scroll to zoom.
Your first media script: clicking an Image shows the next picture, and a Text caption says “Loading…” until the Image reports ready, then the picture’s title.
Click the poster to show the next picture.
An animated GIF on an easel that the player pauses and resumes by clicking it; the script follows the GIF’s play and pause events and lowers the frame rate on phones and headsets.
Click the horses to pause them; click again to resume. Drag to orbit the camera, scroll to zoom.
A Text 3D title registers the Branda font, switches to it, sets its text and shape in one call, then glows between two ambers by tweening only its colour.
Watch the extruded title glow; orbit to see its depth and its shadow. Drag to orbit the camera, scroll to zoom.
A presenter filmed on a green screen is keyed into the scene by a Chroma Key on the Video entity; a script sets the key colour and switches the key, a blue key or automatic measurement from the keyboard.
Click the scene, then press K to turn the key off and on, B to key a blue screen instead, and A to let the key measure the screen colour itself. Drag to orbit the camera, scroll to zoom.
A framed picture whose frame turns gold and thickens while the pointer is over it: an Image with a Frame, a Selectable and a Signal Emitter, restyled by a Behavior script.
Move the pointer over the picture and away. Drag to orbit the camera, scroll to zoom.
A framed picture on an easel shows a .ktx2 texture, which stays compressed in GPU memory. The script logs its pixel size when it is ready.
The picture on the easel is a KTX2 texture; the log gives its size. Drag to orbit the camera, scroll to zoom.
A script draws a clock on a canvas and writes it into a stream that one screen plays; clicking the button publishes your camera to the mirror screen.
Watch the clock screen tick. Click the amber button and allow the camera to see yourself on the mirror. Drag elsewhere to orbit the camera.
Press the goal button and a Lottie confetti burst appears, plays once and hides itself: a Lottie entity saved disabled, played by a script when another script emits goal/reached.
Click the amber button to reach the goal. Click again for another burst. Drag to orbit the camera, scroll to zoom.
Clicking the Lunch or Dinner sign loads that document into the PDF entity's src, back on page 1; a load error falls back to lunch.
Click the Lunch or Dinner sign to show that document. Drag elsewhere to orbit the camera, scroll to zoom.
A name tag over a character waits for its text layout, measures it to fit a dark backing plate, and turns to the camera every frame.
Drag to orbit the camera: the name tag keeps facing you. Scroll to zoom.
A PDF noticeboard turns to the next page every eight seconds, and waits thirty seconds after a visitor turns a page with its pill.
Watch the pages turn every eight seconds, or use the page pill to read at your own pace. Drag elsewhere to orbit the camera, scroll to zoom.
Two UI buttons turn the pages of a PDF handout and a label shows "Page 2 of 3", kept right by the document's own ready and page events: a PDF, a Text and a Behavior script.
Press Next and Previous, or use the pill under the document. Drag to orbit the camera, scroll to zoom.
A poster on a gallery wall shows the next picture each time it is clicked, fitted inside 1.6 × 1.6 m with sizing auto, and the script logs each image's pixel size from its ready event.
Click the poster to show the next picture; the log gives each one's size. Drag to orbit the camera, scroll to zoom.
An SVG logo that breathes gently for ever: an SVG image sized by its entity's scale, tweened by a Behavior script under it.
Watch the logo pulse. Drag to orbit the camera, scroll to zoom.
A 90-second round timer on a board that redraws its text only once a second and turns red for the last ten: a Text entity updated by a Behavior script under it.
Watch the countdown; the last ten seconds turn red. Drag to orbit the camera, scroll to zoom.
A Text entity shows a score that goes up on every point signal and resets on round/start.
Press Point to score, and New round to reset. Drag to orbit the camera, scroll to zoom.
A UI button with a Link opens a ticket page whose address records the room the visitor came from; pressing T opens it from a script too, and every opening is counted from the Link::open event.
Press the Tickets button, or click the view and press T: the page opens in a new tab (example.com) and the log counts the openings. Drag to orbit the camera, scroll to zoom.
Lighting
Section titled “Lighting”A sun and an ambient fill light the scene, and a teal point light with a real-time shadow map circles the objects, so their shadows move with it. Each object casts and receives through its Shadow component.
Watch the shadows follow the teal light as it circles. Drag to orbit the camera, scroll to zoom.
A Day Sky with the runtime Sky & Terrain demo's golden-hour clouds runs from sunrise to sunset in four minutes, stepped once a second, with the Sun light re-aimed and dimmed to match.
Watch the sun climb and the light on the shapes change; a whole day takes four minutes. Drag to orbit the camera, scroll to zoom.
The scene root carries a Day Sky, a Night Sky and Fog; pressing N switches the skies, turns the Sun into cool moonlight and darkens the fog, and back.
Click the scene, then press N to switch between day and night. Drag to orbit the camera, scroll to zoom.
A script under a spot light tweens its intensity down to 0 and back up to 3, two seconds each way, for as long as it runs.
Watch the spot fade out and back in. Drag to orbit the camera, scroll to zoom.
An outdoor HDRI lights a set of statues and shows as the sky; at start the script turns it 90 degrees, blurs and dims the backdrop and softens the lighting, all on the scene root's Environment.
Orbit around the chrome and amber statues to see the HDRI reflected in them, behind its softened backdrop. Drag to orbit the camera, scroll to zoom.
One Hemisphere Light lights everything: tops take its sky colour, undersides its ground colour, with no direction and no shadows. The script steps it through noon, sunset and night.
Watch the tops and undersides of the shapes change colour with each mood. Drag to orbit the camera, scroll to zoom.
A stage spotlight projects a star pattern through its Spot Light Projector; pressing Start the show grows the image from a pinpoint to full size by tweening the projector's zoom.
Press Start the show and watch the stars open across the stage floor and wall. Drag to orbit the camera, scroll to zoom.
At startup a script makes a point light a warm, dim desk lamp, narrows a stage spot to a soft-edged beam, and turns the spot 45 degrees.
See the warm lamp on the desk and the narrow spot turned onto the floor. Drag to orbit the camera, scroll to zoom.
Clicking the switch tweens the room light's intensity between 2.5 and 0 in a quarter of a second.
Click the switch on the wall to turn the light off and on. Drag elsewhere to orbit the camera, scroll to zoom.
Clicking the button switches a projector between a day and a night pattern, zooming the night one and dimming the beam.
Click the blue button on the stand to switch between the day and night patterns. Drag elsewhere to orbit the camera, scroll to zoom.
A kitchen whose light probe volume was never baked gets its hemisphere fill light raised so it is not left dark: a Light Probe checked by a Behavior script at startup.
The volume is not baked, so the fill light is raised to 0.7. Drag to orbit the camera, scroll to zoom.
The runtime Light Probes demo's room: red and green walls, a lamp and a probe volume, with a Light Probe Solver on the scene root. The script reports the solver's settings and whether the volume is baked; baking itself runs in the editor.
Read the log: in play the solver cannot bake, so the volume reports itself unbaked. Download the project and press Bake in XR Creator to see the walls' colours bleed onto the spheres. Drag to orbit the camera, scroll to zoom.
The cheap procedural Sky, with a sun disc: the script steps the sun's elevation from morning to a low sunset and back, raising the haze near the horizon, and aims the Sun light along `sunDirection`.
Watch the sky redden as the sun sinks to the horizon, then rise again. Drag to orbit the camera, scroll to zoom.
At startup a script gives a spot light's beam a faint opacity and a 6 m length, then projects an image on the wall through its Spot Light Projector.
See the faint shaft of light and the image it projects on the wall. Drag to orbit the camera, scroll to zoom.
An avenue of columns under a hazy sky: Fog closes in over four seconds when you press Fog and pulls back when you press Clear, with near and far tweened together on the scene root's Fog.
Press Fog and watch the far columns fade into the mist, then press Clear. Drag to orbit the camera, scroll to zoom.
At startup a script switches on a lamp's shadow map, lets a crate receive shadows and gives the floor a soft contact shadow: Light Shadow, Shadow and Contact Shadow components set from a Behavior script.
Orbit around to see the lamp's shadows and the soft contact shadows under each object. Drag to orbit the camera, scroll to zoom.
The [ and ] keys halve and double a lamp's shadow map size and B toggles a bias; a listener logs every change the Light Shadow reports.
Click the scene, then press [ to blur the shadows with a smaller map, ] to sharpen them, and B to toggle the bias. Drag to orbit the camera, scroll to zoom.
A script on a projector spot light shows the next image of a list every five seconds, waiting for each one to load.
Watch the slides change on the wall every five seconds. Drag to orbit the camera, scroll to zoom.
A photo-studio softbox: a Rect Area Light with the runtime Lobby demo's warm settings throws soft, even light from a whole rectangle, and the script cycles its colour and size.
Watch the soft light on the floor and the shapes change as the panel changes colour and size. Drag to orbit the camera, scroll to zoom.
A full-moon night sky whose stars come out over twenty seconds, with a directional light aimed at the moon: a Night Sky on the scene root driven by a Behavior script.
Watch the stars come out, then look up at the moon. Drag to orbit the camera, scroll to zoom.
Pressing T moves the root's Day Sky on by a tenth of the day; the script turns the Sun directional light to the sky's sun direction and warms and dims it near the horizon.
Click the scene, then press T to advance the time of day and watch the shadows and light follow the sun. Drag to orbit the camera, scroll to zoom.
A searchlight sweeps left and right with a visible beam, which flares when you press F: a Spot Light with a Spot Light Beam, turned by a Behavior script under it.
Watch the beam sweep, and press F to flare it (click the scene first so it has the keyboard). Drag to orbit the camera, scroll to zoom.
A wall torch whose orange point light flickers, drifting toward a new random brightness fourteen times a second: a Point Light changed by a Behavior script under it.
Watch the light wander over the wall and floor. Drag to orbit the camera, scroll to zoom.
Cameras
Section titled “Cameras”An orbit camera circles a statue inside a walled yard. Its Camera Collision sweeps from the statue to the camera, so when you orbit behind a wall the camera is pulled in front of it, and eases back out once clear.
Drag to orbit until a wall comes between you and the statue: the camera slides in front of the wall instead of behind it. The log reports how far it was pulled in.
A UI label that names the camera rendering now, read from CameraDirector.current, and marks it when it is the main camera.
Read the label. Drag to orbit the camera, scroll to zoom.
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.
Click a barrel to blow it up: the guide's ExplosionShake script plays the camera's Tremor effect, strong for the barrels near you and weaker for the far ones.
Click the nearest barrel, then the farthest one, and compare how hard the view shakes. Drag to orbit the camera, scroll to zoom.
Your first camera script: press C to cut from the main camera to a security camera with CameraDirector.switchTo, and C again to come back.
Click the view, then press C to switch cameras, and C again to switch back.
A Fly controller lets the camera move anywhere, ignoring gravity: WASD to fly, drag to look. The script switches between a gentle and a fast speed when you press F.
Click the view, then fly with WASD and drag to look around the ring of pillars; press F to switch between slow and fast flight.
A help panel follows the camera with a Follow Target; a script shows a green dot on it only while isFollowing says it is gliding to a new place.
Drag to orbit the camera beyond the panel’s tolerance: the green dot shows while the panel catches up. Scroll to zoom.
A script points a UI panel’s Follow Target at the main camera, 1.2 m ahead and a little low, with tolerances that let you glance around before it glides back in front.
Drag to orbit the camera a little: the panel stays put. Turn further than 35° and it glides back in front of you.
A text label with a Follow Target: selecting a moving exhibit retargets the follower to it and shows the exhibit's name; deselecting hides it.
Click an exhibit, then another, and watch the label follow it as it moves. Drag to orbit the camera, scroll to zoom.
A cutscene camera flies a Motion Path once; the script cuts to it with CameraDirector, then cuts back to the main camera when the path's end arrives on a filtered signal.
Watch the fly-around, then drag to orbit the camera once control comes back.
A kinematic lift on a two-point Motion Path: each press of Call lift reverses the points, rewinds and plays, so the lift rides up or down and carries the crate on it.
Press Call lift to send the lift up, and again to bring it down. Drag to orbit the camera, scroll to zoom.
An Orthographic Camera looks straight down on a little town, with no perspective: the mouse wheel changes its size, the height of the view, the arrow keys move it across the map, and a click selects a house, shown with an animated outline.
Turn the mouse wheel over the map to zoom between 5 and 60 m of view height. Click a house to select it, then hold the arrow keys to move across the map.
A pet with a Follow Target trails a hero walking a circle; Sit pauses the follower where it stands and Come lets it catch up again.
Press Sit to stop the pet, and Come to let it run after the hero again. Drag to orbit the camera, scroll to zoom.
Holding the left mouse button fires every 0.12 seconds, and each shot kicks the view through the camera's Camera Recoil effect.
Hold the left mouse button over the view to fire and watch the view climb.
While the right mouse button is held, a script on the camera eases its Perspective Camera's field of view from 60° to 20°, and back on release.
Hold the right mouse button to zoom in on the far target, and release it to zoom out. Drag to orbit the camera.
Three named cameras watch a small town: each press of Tab cuts to the next feed with CameraDirector.switchTo, and after the last one, or on Escape, back to the main camera.
Click the scene, then press Tab to step through the lobby, vault and roof cameras; press Escape to return to your own view.
A Third Person camera that follows whichever car you click: the script passes the clicked entity as the controller target.
Click a car to follow it. Drag to orbit it, scroll to zoom.
A first-person camera with Breathing, Head Bob and Dizzy effects: Poison and Cure play and stop the dizzy sway, and Open menu and Close menu switch the breathing and the walking bob off and on.
Walk with WASD to feel the head bob and drag to look around; press Poison to get dizzy, Cure to recover, Open menu to steady the view.
The player camera carries a First Person and a Third Person controller; pressing V enables the one that is off, and the runtime turns the other off.
Click the scene, then press V to switch between following the hero and looking through your own eyes. In first person, WASD moves and dragging looks around.
At startup the script cuts to three viewpoint cameras in turn, four seconds each, scheduling each cut with delay, then hands the view back to the main camera.
Watch the tour cut between three viewpoints, then return to the orbit camera. Drag to orbit the camera, scroll to zoom.
Post-processing
Section titled “Post-processing”The camera's ASCII effect redraws a sunny courtyard as text characters. Buttons switch between the full-colour look and a green terminal, and between fine and coarse cells.
Press Colour, Terminal or Coarse, and orbit the camera to watch the characters follow the shapes. Drag to orbit the camera, scroll to zoom.
Click a barrel and it disappears in a shock wave that ripples across the screen from where it stood: a Shock Wave effect on the camera, played by a Behavior script from Selectable clicks.
Click the barrels one by one. Reload to bring them back. Drag to orbit the camera, scroll to zoom.
The camera's Glitch effect tears and shifts the view now and then, like a damaged feed. Buttons switch between a calm feed, the default glitches and a badly broken signal.
Press Calm, Glitchy or Broken and watch how often and how hard the picture tears. Drag to orbit the camera, scroll to zoom.
Pressing Space steps the camera through five looks, from natural to old photo and noir, by changing the props of its Hue/Saturation, Sepia, Grayscale and Vignette effects.
Click the scene, then press Space to switch to the next look. Drag to orbit the camera, scroll to zoom.
Your first effect: a script adds Bloom and Vignette to the main camera, only when they are missing, so bright objects glow and the edges darken.
Look at the glowing shapes and the darker corners. Drag to orbit the camera, scroll to zoom.
A flashback cuts to a camera with Sepia, Noise and Vignette effects and halves the game speed; after eight seconds of real time it cuts back to the main camera.
Press Flashback: for eight seconds the scene turns sepia and the orbiting ball slows down. Drag to orbit the camera, scroll to zoom.
The camera's Dot Screen effect turns the view into printed halftone dots, at the runtime Effects demo's strength. The script turns the dot grid and steps it between fine and coarse.
Watch the dot grid turn and change size every few seconds. Drag to orbit the camera, scroll to zoom.
On player/hurt, the camera's Vignette darkens sharply and eases back with a tween, while its Glitch effect tears the image for 400 ms.
Press Hurt to flash the screen. Drag to orbit the camera, scroll to zoom.
Pixelation, Scanline and Noise effects on the camera make the scene look like an old monitor; pressing Space tweens all three in or out together.
Click the scene, then press Space to fade between the retro look and the clean picture. Drag to orbit the camera, scroll to zoom.
A storm wets the camera lens and its end lets the drops dry: a Lens Drops effect kept enabled and wiped at start, driven by Storm, End storm and Wipe buttons.
Press Storm to start the rain on the lens, Wipe to clear it at once, End storm to let it dry. Drag to orbit the camera, scroll to zoom.
An Audio Analyzer on a looping beat: each frame a Behavior script averages the lowest frequency bins and scales the speaker cone with them.
Click once to let the browser start the sound, then watch the amber cone jump on every kick drum. The beat is a short loop generated for this example. Drag to orbit the camera, scroll to zoom.
Every button of a menu plays the same short click, rewound on each press so fast presses all sound: one Audio entity with autoplay off, played by a Behavior script on a shared signal.
Press the buttons, quickly too. Drag to orbit the camera, scroll to zoom. The click is a tiny sound generated for this example.
A sound inside an Audio Zone gains a long Reverb as the listener walks in: the zone's enter and exit events tween the filter's wet mix up and down.
With your sound on, hold W for about a second to walk the camera into the cave: the drum beat inside sounds, and the cave's reverb swells in. Hold S to walk out. Sounds inside a zone are silent from outside it. The beat is a short loop generated for this example.
An Audio Chorus Filter on an ambient pad: a UI Switch fades its wet mix in and out with a tween, and two sliders set how fast and how far the copies waver.
With your sound on (headphones help), flip Chorus on and off and listen to the pad widen and shimmer. Raise Speed and Depth for a stronger wobble. Drag outside the panel to orbit the camera, scroll to zoom.
An Audio Distortion Filter on the music switches on below 60 health and grows harder with each hit, in four steps; healing switches it off again.
With your sound on, press Take a hit a few times: past the third hit the beat starts to crunch, harder at each hit. Press Heal to clean it. The beat is a short loop generated for this example. Drag outside the panel to orbit the camera.
A sawtooth chord on an Audio Tone swells in over 0.8 s on door/open and fades out over 2.5 s on door/close.
Press Open door to swell the chord in, and Close door to let it fade.
Two UI Sliders drive the delay time and feedback of an Audio Echo Filter on a looping beat; one listener tells the sliders apart by entity id.
With your sound on, click once to start the audio, then drag the sliders: longer times space the repeats out, more feedback makes them last. The beat is a short loop generated for this example. Drag outside the panel to orbit the camera.
Every frame a script reads an Audio Analyzer's frequency data, splits the lower half into eight bands and scales a bar to each band's level.
Click once to let the browser start the sound. Then watch the bars jump with the beat. Drag to orbit the camera, scroll to zoom.
Your first sound: background music on an Audio entity, and a radio that pauses and resumes it when clicked, with the source’s own events in the log.
With your sound on, click the radio to pause the music, and again to resume it.
Each collision of a crate moves one Positional Audio thud to the contact point and plays it there, so you hear where the crate landed.
Click once to let the browser start the sound. Then grab a crate, lift it and drop it to hear it land where it falls. Drag elsewhere to orbit the camera.
A jukebox plays three tracks one after another, moving on at the end event; N and P skip forward and back.
Click once to let the browser start the sound. Then press N for the next track and P for the previous one. Drag to orbit the camera, scroll to zoom.
The keys A to K hold notes from C4 to C5 on an Audio Tone: attack on key down and release on key up, like a piano.
Click the scene, then hold the keys A, S, D, F, G, H, J and K to play from C4 to C5.
Party music muffled behind a closed door opens up when the door opens: a Low Pass filter on a Positional Audio, its cutoff changed by a Behavior script on door signals.
With your sound on, press Open door and Close door and listen to the music change. Drag to orbit the camera, scroll to zoom.
A tune written as text, one note per beat with - for rests, is scheduled on a Positional Audio Tone at 160 beats a minute.
Click the scene, then press Space to play the tune and Escape to stop it. Orbit around the music box to hear it move.
While a narration track plays, a tween lowers the music to 0.2 of its volume, and brings it back to 0.8 when the narration ends or stops.
Click once to let the browser start the sound. Then press Narrate: the music dips while the narration (a rain recording here) plays, and comes back after it.
M hides and shows the music entity: hidden, it keeps playing silently, so it comes back in place instead of from the start.
Click once to let the browser start the sound. Then press M to mute the music and M again to bring it back where it would be.
Click a radio to switch its music on and off; while it plays, it drives 10 m away and back, and the music fades to silence and returns: a Positional Audio with a linear fade under a Selectable mesh, played and paused with its trip by a Behavior script.
With your sound on, click the radio: the music fades to silence as it drives away and comes back as it returns. Click it again to stop both.
Two Audio Zones, a library with rain on its windows and a workshop with a drum loop: their enter and exit events name the room in a HUD label and lower the hall music.
With your sound on, hold A for half a second to walk into the library, or D to walk into the workshop. Inside a room you hear only its own sound, and the label names it. The rain and the beat are short loops generated for this example.
Five stones each carry a child Positional Audio Tone: bouncing balls land on them, and the stones' collision events play each one's note from where it sits.
With your sound on, click once to start the audio, then listen: every bounce plays the stone's note, and the log shows its frequency. Run the example again to replay. Drag to orbit the camera, scroll to zoom.
On puzzle/solved, an Audio Tone schedules a rising C major arpeggio and a final chord in one go.
Press Solve puzzle to hear the jingle.
Three UI buttons that each play a short, clean beep when pressed: an Audio Tone shaped once and played by a Behavior script, with no sound file to load.
Press the buttons to hear the blip. Drag to orbit the camera, scroll to zoom.
A Behavior script adds a High Pass, a Low Pass and a Distortion filter to an Audio entity at startup, so whatever it plays sounds like a small radio speaker.
With your sound on, press Play the call: the loop comes out thin and crackly, with its bass and air filtered away. The beat is a short loop generated for this example. Drag to orbit the camera, scroll to zoom.
Rain and wind ambiences with an Audio Fade each: a Behavior script only enables and disables the two Audio entities, and the fades cross over two seconds.
With your sound on, press Rain: the wind fades out as the rain fades in over two seconds. Press Clear to swap back. The rain is a short loop generated for this example. Drag outside the panel to orbit the camera.
A world-space UI: a UI Panel root laid out as a column, two UI Labels and a UI Button whose press a script counts.
Press the button. Drag to orbit the camera, scroll to zoom.
A script gives every child of the Exhibits group a billboard UI Label with the child’s name, floating above it.
Drag to orbit the camera: the tags keep facing you. Scroll to zoom.
Reset opens a warning notification with Cancel and Reset actions in the middle of the screen; confirming shows a success notification.
Press Reset, then choose Reset or Cancel in the dialog.
A script defines a shop notification built from UI entities, with Buy and Cancel buttons that answer it.
Press Open shop, then Buy or Cancel in the panel that appears.
Three UI Checkboxes drawn as radio buttons and made exclusive by a UI Selection Group, which a Behavior script adds; the log reports the chosen difficulty.
Pick Easy, Normal or Hard: the others turn off and the log names your choice. Drag outside the panel to orbit the camera, scroll to zoom.
An inventory panel that a Behavior script makes draggable: a Grabbable, a UI Handle grip under it and an opaque UI Backdrop so it is not see-through from behind.
Drag the grip under the panel, or the panel itself, to move it. Drag the background to orbit round and see its solid back; scroll to zoom.
Emojis in UI text: a label and buttons whose text is an emotion emoji. Each button copies its emoji into the big label.
Press a face to show that mood large on the card. Drag outside the card to orbit the camera, scroll to zoom.
A File menu with three UI Menu Items, a tooltip added by a script, and an in-scene QWERTY UI Keyboard whose key presses play a click.
Rest the pointer on File to see its tooltip, press it and choose an entry: the log names it. Click the note field and press keys on the in-scene keyboard to hear them click. Drag outside the panel to orbit the camera, scroll to zoom.
A styled label pinned above a box that always turns to face the camera: a UI Label entity created by a Behavior script, with a Billboard, added under the mesh.
Orbit around the box: the tag keeps facing you. Drag to orbit the camera, scroll to zoom.
Each press of the button shows the sample line in the next family of Fonts.families, with its label, and counts through the list.
Press the button to step through the fonts. Drag outside the panel to orbit the camera, scroll to zoom.
Each press of Move steps a screen-space HUD round the four corners of the screen by changing its UI Screen Space anchor.
Press Move to send the HUD to the next corner of the screen.
A UI Image steps through three pictures with Previous and Next; the caption waits for the image’s ready event and reports load errors.
Press Next and Previous to step through the pictures. Drag outside the panel to orbit the camera, scroll to zoom.
A UI List of levels with icons and a locked row: selecting a row enables the Play button, and Play loads the scene whose id is the row's value.
Pick a level in the list, then press Play to load its scene. Frozen Peak is disabled. Run the example again to choose another level. Drag outside the panel to orbit the camera, scroll to zoom.
A UI Progress bar that first sweeps while the wait is unknown, then fills from 0 to 100% with a tween, with a status label beside it.
Watch the bar sweep while it connects, then fill. Run the example again to replay it. Drag to orbit the camera, scroll to zoom.
A UI Input that greets the player as they type and confirms the name on Enter: a Behavior script listens to the field's change and submit events.
Click the field and type a name: the greeting follows each key. Press Enter to confirm it in green. Drag outside the panel to orbit the camera, scroll to zoom.
A script themes every notification once, with colours, a font and a party icon for successes; a connection error overrides the theme for itself.
Press Lose connection to show a themed error notification.
A UI Drawing takes the pointer and draws a line for each pointer with Canvas 2D calls; a UI Button clears it.
Draw on the white canvas with the mouse or a finger, then press Clear.
A Behavior script builds a world-space panel from code, with a title, a divider and a hint laid out as a column: UIPanelEntity, UILabelEntity and UIDividerEntity added to the scene.
Drag to orbit the camera around the panel, scroll to zoom.
A profile card built from a UI Avatar with initials and a status dot, a UI Spacer that pushes the level badge right, and UI Dividers between the stats. Pressing the avatar cycles the status.
Press the avatar to cycle Online, Away and Busy: the status dot and the label change together. Drag outside the panel to orbit the camera, scroll to zoom.
One notification with an id is updated in place: a progress bar fills over three seconds, turns indeterminate while unpacking, then reports done.
Watch the notification in the bottom-right corner fill, unpack and finish. Reload the example to see it again.
Reset asks first: a Warning notification with Cancel and Reset actions reports the answer on its signal, and the script reads the UI Notification component of the dialog it opened. A tip above the crates is a UI Notification entity pinned in the world.
Press Scatter crates, then Reset level: a dialog asks first. Press Reset to send the crates home, or Cancel or a press outside it to keep them. Drag outside the panels to orbit the camera.
Every frame a script redraws a round UI Drawing in the corner of the screen with a dot at the player's position on a 40 m map.
Watch the red dot on the minimap follow the amber player around the yard. Drag to orbit the camera, scroll to zoom.
A long link in a monospaced font wraps anywhere inside a 280 px width, and is clipped at 60 px high, so it never spills out of its panel.
See the long link wrap inside the panel. Drag outside the panel to orbit the camera, scroll to zoom.
A Buy button shows its price in its text and how many torches you own in its badge, and is disabled until you have enough coins.
Press Pick up a coin five times to afford a torch, then press Buy. Drag outside the panel to orbit the camera, scroll to zoom.
A UI Image that steps through three pictures with Previous and Next buttons; the caption waits for the image's ready event and reports load errors.
Press Next and Previous to step through the pictures; the caption updates once each one has loaded. Drag outside the panel to orbit the camera, scroll to zoom.
A script fills a row panel with a title, a UI Spacer and two buttons, so the title sits on the left and the buttons on the right; Close hides the toolbar.
Press Share to log a message, and Close to hide the toolbar. Drag outside the panel to orbit the camera, scroll to zoom.
A character preview inside a panel: a UI Render View shows a UI Render Scene with its own camera and lights, and a Behavior turns the model in it.
Watch Amelia turn inside the panel: she lives in the render scene, lit by its own lights. Drag outside the panel to orbit the camera, scroll to zoom.
A settings panel whose volume slider, mute switch and reset button drive the music: UI Slider, UI Switch and UI Button events handled by one Behavior script that sets an Audio volume.
With your sound on, move the slider, flip Mute and press Reset. Drag outside the panel to orbit the camera, scroll to zoom. The music is a short loop generated for this example.
A notification shown once and updated in place: a progress bar driven by Tween.value, a sweeping bar, then a success toast with the same id.
Watch the notification at the bottom right of the view.
A numeric UI Keyboard placed in the scene types into a number field; a Behavior script checks the code on submit and swings the vault door open with a tween.
Click the code field, then press 2, 4, 6, 8 and the enter key on the in-scene keypad. A wrong code clears the field. Drag outside the panel to orbit the camera, scroll to zoom.
A UI Video in a panel with a UI Toggle Button that plays and pauses it and a volume slider; the button's label follows the video's own play and pause events.
Press Play to start the video with sound, press again to pause, and drag the slider to change the volume. Drag outside the panel to orbit the camera, scroll to zoom.
A welcome toast that slides in at the bottom right when play starts and closes by itself after six seconds: NotificationService.show from a Behavior script, with nothing to prepare in the scene.
Watch the bottom-right corner of the view. Reload the example to see it again.
Physics
Section titled “Physics”Dynamic rigid bodies with box and sphere colliders fall onto a floor that has only a collider, so it is fixed. Clicking a body gives it an upward impulse.
Click a box or a ball to throw it up. Drag to orbit the camera, scroll to zoom.
A ball rolls down a ramp and off its end; once it is 10 m down, teleport puts its body back at its starting place, and it rolls again.
Watch the ball roll off the ramp, fall and come back to the top. Drag to orbit the camera, scroll to zoom.
A statue of three parts welded by a Fixed Joint stands as one object until a falling wrecking ball hits it faster than 6 m/s: the script then disables the joint and the parts fall apart.
Watch the ball drop onto the statue and break the weld. Press Relaunch to see it again. Drag to orbit the camera, scroll to zoom.
Six pins with Capsule Colliders, which fit tall rounded shapes exactly, stand on a lane; every few seconds the script rolls the amber ball into them, then teleports the pins back up.
Watch the ball knock the pins over and the pins stand up again for the next roll. Drag to orbit the camera, scroll to zoom.
E switches a crate between kinematic, led in front of the camera with setKinematicTarget, and dynamic, falling freely; its collider is kept.
Click the scene, then press E to pick the crate up, orbit the camera, and press E again to drop it.
Two gates are sensor colliders on the signal checkpoint: walking through one makes it the respawn point, and Respawn teleports the player's Character Controller back to the last one reached.
Click the scene, walk through a green gate with WASD, wander off, then press Respawn to return to the gate. Drag to look around.
Traffic cones tumble onto the ground and settle on their bases or roll on their sides, because each Cone Collider has the cone's own shape, tip up. The script drops them again every few seconds.
Watch where the cones come to rest: upright, tipped over or rolling on their sides. Drag to orbit the camera, scroll to zoom.
Faceted rocks fall and tumble to rest on their flat faces: each Convex Hull Collider wraps its rock's mesh, squashed or not, as tightly as a convex shape can. The script drops them again every few seconds.
Watch the rocks bounce off each other and settle on a face, never on a corner. Drag to orbit the camera, scroll to zoom.
A chandelier swings from a fixed hook on a Rope Joint; pressing the button raises cut and the script disables the joint, so the chandelier falls.
Press Cut the rope. Drag to orbit the camera, scroll to zoom.
A power-up moves the player's Character Controller to a Ghost physics layer that ignores the Walls layer for five seconds, so the player walks through walls.
Walk with WASD into a wall, then press Ghost mode and walk through it within five seconds.
A guard’s sight ray tests only the Default and Walls layers, so it is blocked by the wall but sees through the window on the Glass layer; an Enable On Signal shows when it spots the player.
Drag the blue player behind the grey wall to hide it, or behind the glass, where the guard still sees it and the pink alarm lights. Drag elsewhere to orbit the camera.
A ball counts its solid contacts from collision-enter and collision-exit, and Space kicks it upwards only while it touches something, so it cannot jump again in mid-air.
Click the scene, then press Space to make the ball jump. Pressing again in mid-air does nothing. Drag to orbit the camera, scroll to zoom.
A fairground high striker: the puck rides a Prismatic Joint that lets it slide only along the pole. Every few seconds the script strikes it upward with a random impulse and logs how high it went; a hard hit rings the bell.
Watch the puck shoot up the pole and slide back down, staying on its axis whatever the impulse. Drag to orbit the camera, scroll to zoom.
While Space is held, a lasting upward force lifts a drone; releasing Space removes it with resetForces, and gravity brings the drone back down.
Click the scene, then hold Space to lift the drone and let go to drop it. Drag to orbit the camera, scroll to zoom.
A falling crate copies a disabled Sparks entity at the contact point with spawn whenever it lands faster than 4 m/s, and destroys the copy a second later.
Watch the crate land in a burst of sparks. Grab it, lift it high and let it drop to see them again. Drag elsewhere to orbit the camera.
A sensor pad that sets the vertical velocity of every dynamic body entering it, so light and heavy bodies leave at the same speed.
Watch the bodies bounce on the pad. Drag one off the pad or back onto it.
A click on the ball casts a physics ray and applies an impulse along it at the point hit, so an off-centre click also sets the ball spinning.
Click the ball to kick it away from you; click its edge to make it spin. Drag to orbit the camera, scroll to zoom.
Bodies that enter a sensor zone get a gravity scale of 0.15 and float down gently; leaving it restores normal gravity. A second listener logs when each crate settles or moves again.
Watch the crates over the blue zone drift down while the other one drops. Grab a crate and lift it into the zone again. Drag elsewhere to orbit the camera.
A big static ring has a Mesh Collider, which uses its exact triangles: marbles that land on the ring roll off it, and marbles over its hole fall straight through, which no box or convex shape would allow.
Watch the marbles over the hole drop through it and the others bounce off the ring. Drag to orbit the camera, scroll to zoom.
A kinematic platform slides back and forth with setKinematicTarget every frame, carrying the dynamic crates that rest on it.
Watch the platform carry the crates to and fro. Grab a crate and drop it back on. Drag elsewhere to orbit the camera.
A sensor plate counts the bodies on it: the first one in opens the door, the last one out closes it again, each through an Enable On Signal on the door.
Drag a crate onto the green plate to open the door; add the other one, then take both off to close it. Drag elsewhere to orbit the camera.
A pendulum hangs from a fixed pivot on a Spherical Joint, a ball and socket; each press of P gives the bob a sideways impulse and it swings, free to turn in any direction about the pivot.
Click the view, then press P to push the bob; press it again mid-swing to add to the swing. Drag to orbit the camera, scroll to zoom.
A sensor Box Collider in the goal reports the ball passing into it with PhysicsCollider::intersection-enter, and a script counts the goals.
Drag the ball into the blue goal and let go. Scroll to zoom.
Items hung on a pegboard are fixed scenery with only a Box Collider; on shelf/shake, the script adds a dynamic Rigid Body to each one, and they fall.
Press Shake the shelf to make every item fall. Drag to orbit the camera, scroll to zoom.
A bridge of planks linked in a chain by a Spring Joint, held at both ends: it sags and sways under a ball, and Pull the lever stiffens the springs so it holds firm, with the same rest lengths.
Watch the bridge sag under the ball, then press Pull the lever to make it firm, and again to let it sway. Drag to orbit the camera, scroll to zoom.
A door panel hangs on a Revolute Joint with a vertical hinge axis. Each press of Wind gust turns it with a torque impulse about the hinge: a shut door blows open, an open one slams shut against its stop.
Press Wind gust to blow the door open, then press it again to slam it shut. Drag to orbit the camera, scroll to zoom.
Animation
Section titled “Animation”A balloon dog hops on an Animation Timeline while Dynamic Spring Bones bounce its ears and Dynamic Velocity Bones swing its tail behind the motion.
Watch the ears bounce and the tail trail behind each hop. Drag to orbit the camera, scroll to zoom.
A door with an open timeline layer gets a two-state Animation Graph from a Behavior script, and one shared signal from a button opens and closes it.
Press Toggle door to open the door, and again to close it. Drag to orbit the camera, scroll to zoom.
Your first animation: a character idles, blends into its Walk clip while W is held and back to Idle when it is released, with an Animation Clip and its layers.
Click the view so it has the keyboard focus, then hold W to walk and release it to stop.
A script turns a character's Head bone with a sine wave through its Skeleton and drives its mouthOpen and mouthSmile morph targets through its Morph component.
Watch the head turn and the mouth talk. Click the scene and hold S to smile. Drag to orbit the camera, scroll to zoom.
A script turns a character's Head bone with a sine wave every frame, through its Skeleton component.
Watch the head sway from side to side. Drag to orbit the camera, scroll to zoom.
A gem hovers up and down and spins for ever on an Animation Timeline that a Behavior script builds in code, with a smooth pingpong layer and a linear repeating one.
Watch the gem hover and spin. Drag to orbit the camera, scroll to zoom.
A character's head turns toward the camera through the humanoid rig, limited to 60 degrees each way and eased so it never snaps.
Drag to orbit the camera around the character: her head follows you, up to 60 degrees each way. Scroll to zoom.
While R is held, a script eases the right arm's upper and lower joints up, found by role with the humanoid rig's chain.
Click the scene, then hold R to raise the right arm and release it to lower it. Drag to orbit the camera, scroll to zoom.
A Skeleton component with a humanoid rig resolves Amelia's bones into humanoid roles. The script asks it for the head and the right arm by role, not by bone name, and makes her look around and wave.
Watch Amelia turn her head and wave; the log lists the bones the rig resolved. Drag to orbit the camera, scroll to zoom.
A script adds Dynamic Spring Bone components to the bones of a loaded stick, then swings the stick from side to side so its tip lags and whips behind.
Watch the tip lag behind. Click the scene and press Space to stop the shaking and watch the stick settle. Drag to orbit the camera, scroll to zoom.
A character stands idle; Space crossfades it into its Walk clip and back through the Animation Clip layers, and the arrow keys change the walk's speed.
Click the scene, then press Space to start or stop walking, and the Up and Down arrows to change the walk speed. Drag to orbit the camera, scroll to zoom.
Movement
Section titled “Movement”Every state-change of a Character Controller plays the matching clip of the character's model: Walk while moving and Idle at rest. States without a clip are skipped.
Click the scene, then walk with WASD or the arrow keys: the character switches between its Walk and Idle clips. Drag to look around.
A character with a Character Controller and no player controls runs towards the main camera every frame with move, and stops two metres short.
Drag to orbit the camera around the yard: the chaser turns and runs after you, and stops when it is close. Scroll to zoom.
A player walking off a floating platform falls until it is 20 m down, then teleport puts the Character Controller back at the start, turned half a turn, with its fall cancelled.
Click the scene, then walk off the edge of the platform with WASD: after the fall you are back at the start. Drag to look around.
Your first moving player: a first-person camera with a Character Controller walks, runs and jumps; the script plays a Camera Impact each time the character lands.
Click the view to look around with the mouse. Walk with WASD, run with Shift, and press Space to jump: the view dips as you land.
The player's Character Controller reports the sensor pads it walks into: a pad named Jump Pad launches it 4 m up, and E jumps higher than the built-in jump on Space.
Click the scene, then walk with WASD onto a green pad to be launched. Press E for a high jump and Space for the normal one. Drag to look around.
A guard with a Character Controller walks from post to post: moveTo starts each leg and the controller's arrive event ends it.
Watch the guard walk between the grey posts. Drag to orbit the camera, scroll to zoom.
Starting a puzzle switches the player camera's Teleport off, so the player cannot aim at all; solving it switches the Teleport back on.
Hold the right mouse button on the floor to aim, release to teleport. Press Start puzzle and try again: nothing happens until you press Solve puzzle.
A script gives the player camera's Teleport a short green arc, counts the arrive events, and extends the range after five teleports.
Hold the right mouse button on the floor to aim, release to teleport. Left-drag to look around.
Navigation
Section titled “Navigation”An amber bodyguard with a Steering Interpose keeps itself between a wandering VIP and the threat that seeks it, and a label shows how close it is to the line between them.
Watch the amber bodyguard slide into place between the violet VIP and the blue threat, and follow them as they move. Drag to orbit the camera, scroll to zoom.
An amber cat with a Steering Pursue chases the nearest of four mice, cutting them off, while each mouse uses a Steering Evade to dodge where the cat is heading.
Watch the cat cut the mice off and the mice veer away once it comes within 3 m; the label names its current prey. Drag to orbit the camera, scroll to zoom.
Each click is cast onto the scene, snapped to the navmesh with closestPoint, and the hero walks there round the walls through its NavMesh Agent and Character Controller.
Click the floor to send the hero there. Drag to orbit the camera, scroll to zoom.
A script turns three landmarks into a Steering Follow Path for a courier; at the last stop the Steering Agent sends arrive, and the round starts again five seconds later.
Watch the amber courier visit the bakery, the fountain and the library in order; at the library the log reports the round, and the next one starts after five seconds. Drag to orbit the camera, scroll to zoom.
Your first walking character: a NavMesh Agent walks to the point of the floor under a click, round the walls, found with GraphicsRaycaster.
Click anywhere on the floor: the capsule walks there, round the walls.
A script gives five steering agents Follow Leader, Flock and Avoid behaviours, and two crates a Steering Collidable, so the flock trails a wandering leader round the crates.
Watch the blue flock follow the amber leader. Drag to orbit the camera, scroll to zoom.
A guard patrols a loop with Steering Follow Path; when the camera comes within 15 m, the script hands over to Steering Pursue and speeds it up, and an Enable On Signal lights its alarm.
Scroll in to bring the camera closer than 15 m: once the guard faces you, it runs at you. Scroll out to let it return to its patrol. Drag to orbit the camera.
The arrow keys walk the player along four Spot Points with travel(); each stop is aligned so the player faces what is there to see.
Click the scene, then press the right arrow to go to the next stop and the left arrow to go back. Drag to look around.
A hero walks back and forth between two platforms that do not touch: a NavMesh Link across the gap lets its path continue, and the script logs when the agent leaves the ground to cross it.
Watch the hero jump the gap on each crossing. Drag to orbit the camera, scroll to zoom.
Five cars follow a looping Steering Follow Path round a track; the fast ones carry a Steering Queue, so they brake behind the slow amber car and wait in line.
Watch the blue cars catch up with the slow amber one and queue behind it; the speeds at the top drop as they brake. Drag to orbit the camera, scroll to zoom.
A button raises maze/built and the script rebakes the NavMesh Surface from the walkable floor and collidable walls, logging the bake's progress.
Press Bake and watch the progress in the script log. Drag to orbit the camera, scroll to zoom.
Six agents chase a beacon that jumps every five seconds: three with a Steering Seek rush at full speed, three with a Steering Arrive slow down within 3 m and report each stop.
Watch the blue seekers overshoot and brake hard while the green arrivers ease in; the label counts the Arrive stops. Drag to orbit the camera, scroll to zoom.
Six wandering, flocking sheep each get a Steering Flee from a script, disabled until the wolf howls: then fleeing outweighs the other behaviours and the flock scatters.
Press Howl: the sheep run from the amber wolf until they are 12 m away. Press Wolf leaves and they drift back together. Drag to orbit the camera, scroll to zoom.
A spawn point places the main camera when play starts; its Signal Emitter sends SpawnPoint::place and a script logs where the player arrived.
Read the arrival in the script log. Drag to look around, scroll to zoom.
A wandering Steering Agent's velocity is shown as a speed on a Text sign, updated only when the rounded value changes.
Watch the speed change as the agent wanders, speeds up and turns. Drag to orbit the camera, scroll to zoom.
Three spot points act as seats: clicking a marker travels there and reserves it, and a script counts the occupied and release events they share on one signal.
Click a seat marker to sit there, then another. Watch the script log.
A Travel Point into the vault stays closed until you press Pick up the key; then it opens with a gold ring, and walking into it lands you on the vault's out portal, which reports your arrival.
Press Pick up the key, then walk forward with W into the gold ring to travel to the vault. Drag to look around.
A villager picks a random reachable point near home with randomPoint, walks there with its Character Controller, rests two to five seconds on arrive, and sets off again.
Watch the villager wander around the walls, resting between walks. Drag to orbit the camera, scroll to zoom.
Counts the real tables an AR device detects from the XR Planes events, and emits the count on hud/tables for a HUD to show.
This one needs AR: in a headset or AR phone that labels planes, each table found raises the count. On a desktop no planes are detected.
Your first AR placement: a ring follows the real surface under the viewer’s gaze, and the trigger or a tap places an anchored copy of a hidden chair there.
This one needs AR: open the page on an AR phone or a mixed-reality headset. On a desktop the ray meets no real surface, so the ring stays hidden and no chair is placed.
A UI Button recenters the XR Origin, and the controllers buzz when the XR Origin reports the recenter; a reset from the headset is logged.
Press Recenter. On a desktop there is no XR session to recenter; in a headset the view snaps back to the home placement and the controllers buzz.
On an AR phone, a tap on the floor drops an anchored copy of a hidden plant there: XRRaycaster.fromScreen finds the surface, spawn copies the plant and anchorAt ties it to the spot.
This one needs AR: open the page on an AR phone. On a desktop there is no real surface to hit, so nothing is placed.
A flat menu pinned to the screen on laptops and phones, swapped for a world-space menu while a headset is presenting: Device.isXRPresenting() checked by a Behavior script that enables one menu or the other.
In this browser preview the flat menu shows at the top left and the world menu stays hidden. In a headset session the world menu would take over. Drag to orbit the camera, scroll to zoom.
An XR World with XR Light Estimate and XR Depth Occlusion: in AR the scene is lit like the real room and real things hide virtual ones. Buttons switch between a fast mode and high realism, with shadows from the real main light and soft occlusion.
This one needs AR: enter AR on an Android phone or a Quest 3 and press High realism. On a desktop there is no estimate or depth, so the stage lights stay in charge and the buttons only change the settings.
XR Planes with an XR Plane Collider and XR Meshes with an XR Mesh Collider make the detected room solid, drawn as translucent blue as in the runtime AR Placement demo. Balls drop every two seconds and bounce on the real floor and furniture.
This one needs AR: enter AR on a device that detects planes or room meshes and the balls land on real surfaces. On a desktop nothing is detected, so a virtual floor catches them.
Multiplayer
Section titled “Multiplayer”Reads one page of the system avatar catalogue with Avatars.list and the avatar the visitor wears with Avatars.getSelected, checking first that the app offers avatars.
Read the log. The preview has no avatar service, so the script reports that avatars are not offered; in a world with accounts it lists the catalogue.
Connects to chat once the scene is drawn, retrying a few times, waits for the snapshot to be ready and sends one greeting to the general conversation.
Read the log. The preview has no Arena room, so after a few retries the script says chat is not available; in a published world it greets everyone once.
Your first shared object: a grabbable crate with a Networkable and transform and material traits; whoever takes it gives it a new colour for everyone.
Drag the crate. The preview has no Arena room, so the log says you are playing alone; in a published world, open it in two tabs to see the crate move and change colour in both.
Reads the roster once with Participants.getSnapshot, then keeps a UI Label up to date with Participants.subscribe, flagging a roster that is still updating.
Read the label and the log. The preview has no room, so the roster is empty; in a published world the count follows people as they come and go.
A script publishes a named stream with Streams.create and writes a plasma frame into it every update; the screen's Media Stream plays it.
Watch the screen. Drag to orbit the camera, scroll to zoom.
A UI Button sends a thumbs-up reaction to the room with Network.command, handles a refusal by its code, and logs the reactions other peers send.
Press the button. The preview has no room, so it logs that reactions need one; in a published world every peer sees your 👍.
A point light shared with a Networkable and a point-light trait: the switch takes ownership with requestOwnership, then turns the light on or off for everyone.
Press Lamp Switch to turn the lamp off and on. In a published world the change reaches every peer.
Start camera publishes your camera as the stream me/camera, which a Video entity with a Media Stream plays; pressing again unpublishes it and stops the camera.
Press Start camera and allow the camera to see yourself on the screen; press it again to stop. Needs a camera and your permission.
A UI Label shows the room and how many others are in it, refreshed on the Networkable’s connect, disconnect, join and leave events.
Read the label. The preview plays alone; in a published world it names the room and counts the people in it.
Logic and AI
Section titled “Logic and AI”A script logs an AI agent's setup at startup, its display name and the provider and model that would answer it, by reading the AI Model and AI Persona props.
Read the agent's setup in the log. No conversation is started, so the example needs no AI service.
An AI Memory names the record that keeps the guide's memory between visits: a UI Switch turns it on and off, and the agent's memory activity events update a label.
Flip Remember me: the label shows whether the guide keeps a memory, and in which record. Reading and writing memory happen during replies, which need the AI service; this preview does not have it, so a message you send shows a short error instead. Drag outside the panels to orbit the camera.
Pressing Q sends a question to an AI agent from a script with conversation.send; the agent's thinking, response and error events arrive through its Signal Emitter and are logged.
Click the scene, then press Q to ask the guide a question and read the answer in the log. The answer comes from the AI service: without one, the log shows why the guide could not answer.
An AI agent's Text To Speech on the WebAPI provider speaks a line when a UI button is pressed, using the browser's own voices: no AI service is needed.
Press Speak to hear the guide. The voices are the browser's own, so they differ between browsers and systems. Drag to orbit the camera, scroll to zoom.
A switch moves a guide's AI Dialog panel and AI Caption between the world, above the guide, and the screen's corner, keeping the world placement for the way back.
Turn on Pin to screen to move the dialog panel to the bottom-right corner of the screen, and off to bring it back above the guide. Moving it needs no AI service; replies need one.
Your first agent: an AI Agent with a persona and a dialog greets the visitor when the scene starts; the script listens to the agent’s signal and logs the finished reply.
Wait for the guide’s answer in the dialog and the log, then type into the dialog to keep talking. The guide needs the AI service: without it, the log says why it could not answer.
An AI Proximity box round the guide shows her dialog only while the camera is near, and a Behavior script hides the "walk up" hint on the proximity's enter event.
Hold W to walk the camera inside the blue ring: the hint goes and the guide's dialog appears. Hold S to walk back out. The greeting itself is sent to the AI service, which this preview does not have, so the panel shows a short error instead of a reply.
A standalone AI Dialog entity above a desk presents the conversation of a guide standing elsewhere in the room: its dialog names the agent by id.
The panel over the desk is Ada's conversation, though Ada stands across the room. Type a message to try it. Replies need the AI service, which this preview does not have: a message you send shows a short error in the panel instead. Drag outside the panel to orbit the camera, scroll to zoom.
Pressing L steps an AI agent's output language through the languages its AI Translation allows, then back to the original, and logs each change from subscribeOutputLanguage.
Click the scene, then press L to change the language. The dialog's language button follows. Translating replies needs the AI service; choosing the language does not.
A UI button opens and closes an AI agent's chat panel: the AI Dialog is saved disabled and a Behavior script toggles it, checking getConfigurationIssue for anything missing.
Press Talk to the guide to open the panel, and again to close it. Opening it needs no AI service; replies need one. Drag to orbit the camera, scroll to zoom.
A script checks every AI Skill on an agent at startup and logs each skill's name and description, or what is wrong with it, using inspect().
Read the skill report in the log: one valid skill, one empty, one with a bad name. No conversation is started, so the example needs no AI service.
An AI Caption shows what the guide's AI Speech To Text hears: her own lines spoken through the browser's voice, and the Radio, which an AI Speech Capture marker selects for transcription.
Press Next line: the guide speaks with your browser's voice and her caption appears above her, also in the log. Transcribing the Radio needs the AI service, which this preview does not have: the log reports it instead. Drag outside the panel to orbit the camera.
A UI Button asks the guide's AI Summarizer for a summary of the visitor's chat: the script checks availability first, then generates and downloads it, reporting each step in a label.
Press Download summary: without the AI service the label explains that summaries are not available, which is the script's first check. With the service, chat with the guide first, then the button saves a PDF. Drag outside the panels to orbit the camera, scroll to zoom.
A script lists an AI agent's tools at startup: each AI Tool's label, how many tools its script declares and whether it is switched on.
Read the tool list in the log. No conversation is started, so the example needs no AI service.
A Persistable adds one to a stored count each time the scene starts, with inc, and a UI Label shows the total, or the last known value when the write fails.
Read the label, then run the example again. Without the persistence service the write fails and the label shows the offline value.