Scripts run sandboxed inside a hidden, permission-locked iframe — no network access, no access to this page, Firebase, or any other tab. Only the objects below are exposed. Top-level code runs once when the script loads; register callbacks to react over time.
onStart(function(){ ... }) // runs once, when the script starts
onStep(function(dt, t){ ... }) // runs every tick — dt = seconds since last tick, t = seconds elapsed
onTouched(function(){ ... }) // runs when the player touches this object (edge-triggered)
object.position / .rotation / .scale / .color / .id / .name // read-only snapshot
object.setPosition(x,y,z) object.move(dx,dy,dz)
object.setRotation(xDeg,yDeg,zDeg) object.rotate(dxDeg,dyDeg,dzDeg)
object.setScale(x,y,z) object.setColor('#ff00aa') object.destroy()
player.position / .name // read-only
player.distanceTo(obj) // obj can be `object` or a world.find() result
player.teleport(x,y,z)
world.find(nameOrId) // look up any object in the scene by its Name or ID
world.all() // array of every object's snapshot
world.setPosition(id, x,y,z) world.move(id, dx,dy,dz)
world.setColor(id, hex) world.setScale(id, x,y,z) world.destroy(id)
print(...) // shows up in the script console (Player: press ` to open it)
wait(seconds) // returns a Promise — use with an async function to pause
The World Script (in the Scene panel) runs once per game session with the same API, minus object —
use it for game-wide rules rather than one object's behavior.