A mini pool you can dive into
Updated
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.
A mini pool you can dive into
#pragma lifecycle(startup)
function startup() { const ball = findEntity('Beach Ball'); Tween.to(ball.position, { y: ball.position.y + 0.06 }, { duration: 1.8, ease: Ease.InOutSine, repeat: Infinity, yoyo: true, });
on('pool', (event) => { if (event.eventType === EventType.WaterVolume.Submerge) log('Under the water: caustics on the floor, bubbles round you'); if (event.eventType === EventType.WaterVolume.Emerge) log('Breaking the surface'); if (event.eventType === EventType.WaterVolume.Exit) log('Back in the air'); });}How it works
Section titled “How it works”The script is explained step by step in A mini pool you can dive into.
Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
WaterPool.xrproj