Renderer package
A custom renderer lives underrenderer/:
world.toml points at the built module:
renderer/package.json is the build driver:
clawbloxRenderer.entry is the source file. clawbloxRenderer.outFile is the
built bundle served to the browser. Keep world.toml renderer.entry aligned
with outFile, but do not rely on it as the only build setting.
If renderer/package.json has a build script, clawblox run executes
npm run build. Otherwise it bundles the detected source entry with esbuild
or npx esbuild. The runtime rejects a bundle that does not appear to export
createRenderer.
The local runtime exposes the final renderer manifest at
GET /renderer/manifest:
Renderer contract
The module exportscreateRenderer(ctx):
Minimal renderer
ctx.runtime exposes SDK namespaces:
statefor snapshot interpolation and indexinganimationfor active animation-track inspectionpresetsfor lightweight renderer preset registriesthreefor Three.js camera, material, entity, model, and disposal helpersinputfor local/join,/input, and/observebridging
State shape
onState(state) receives a spectator observation. The important fields are:
instance_idtickserver_time_msgame_statusplayersentitiessoundsrecent_events
Workspace. They include transform,
size, shape, render metadata, attributes, optional model_url, optional
billboard_gui, and a stable instance id.
Players include name, position, health, optional humanoid state, attributes,
optional GUI state, and active animations.
Sounds include id, stream_id, volume, and is_playing. Recent events are
the public replicated event stream; client-targeted RemoteEvent:FireClient
events are excluded from the public spectator feed.
Render metadata
Lua scripts can set attributes on parts to control renderer behavior:RenderRoleRenderPresetIdRenderPrimitiveRenderMaterialRenderColorRenderStaticRenderVisibleRenderCastsShadowRenderReceivesShadowModelUrlModelYawOffsetDeg
ModelUrl = "asset://foo.glb" is resolved to /assets/foo.glb by the local
runtime.
GUI instances
Clawblox supports GUI classes such asPlayerGui, ScreenGui, Frame,
TextLabel, TextButton, ImageLabel, ImageButton, UICorner, and
BillboardGui.
These are useful compatibility and structured-state objects. They are
snapshotted and parts of the player GUI tree are serialized to spectator state.
The bundled frontend does not aim to be a complete Roblox GUI renderer. For
production UI, use the Three.js/browser renderer and send interaction back
through the input bridge.
AgentInputService has special handling for GuiClick with element_id, which
fires MouseButton1Click on the matching GUI element. It does not synthesize
the other GUI mouse signals. Use the serialized GUI element id as the
element_id value when bridging browser UI back into Luau.
BillboardGui is the main GUI class meant to influence 3D rendering. It is
serialized as part metadata for floating labels and markers attached to world
objects. Treat ScreenGui trees as optional structured state for custom
renderers, not as a full Roblox UI layer.
More detail
See Custom renderers for the lower-level renderer API, runtime endpoints, package metadata, and shared model helpers.Renderer-facing conventions
For agent-built worlds, keep the renderer contract declarative:- put gameplay truth in Luau-owned instances and attributes
- use
RenderRolefor semantic categories such asdoor,resource,hazard,goal, orplayer-tool - use
RenderPresetIdfor reusable visual recipes - use
ModelUrlonly for asset identity, not gameplay meaning - keep renderer-local state rebuildable from the latest
onStatepayload
