A turntable preview
Updated
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 turntable preview
#pragma lifecycle(startup, update)
const SPEED = 0.6; // radians a secondlet model;let scene3d;
function startup() { model = findEntity('Preview Model'); scene3d = model.parent.getComponent(UIRenderSceneComponent); scene3d.setProps({ distance: 2.5, fov: 35, background: 'transparent' });}
function update(dt) { model.rotation.y += dt * SPEED;}How it works
Section titled “How it works”The script is explained step by step in A turntable preview.
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.
TurntablePreview.xrproj