A spotlight logo that follows a moving platform
Updated
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.
A spotlight logo that follows a moving platform
#pragma lifecycle(startup, update)
let decal;let platform;let lastX = 0;let fast = false;
function startup() { decal = findEntity('Logo Projector').getComponent(DecalComponent); decal.setProps({ type: 'dynamic', color: '#ffffff' });
platform = findEntity('Platform'); lastX = platform.position.x; Tween.to(platform.position, { x: platform.position.x + 4 }, { duration: 3, ease: Ease.InOutSine, repeat: Infinity, yoyo: true });}
function update(dt) { if (dt === 0) return; const speed = Math.abs(platform.position.x - lastX) / dt; lastX = platform.position.x;
const isFast = speed > 1.5; if (isFast === fast) return; fast = isFast; decal.setProps({ color: fast ? '#f97316' : '#ffffff' });}How it works
Section titled “How it works”The script is explained step by step in A spotlight logo that follows a moving platform.
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.
ProjectedLogo.xrproj