Roblox Building and Lighting
When to Load
Building, fixing or reviewing world geometry, maps, props, generated or store assets, terrain, lighting, atmosphere or post-processing. Draw calls, triangle and memory budgets: roblox-performance; constraints, assemblies, rig joints in motion: roblox-physics; the full Studio MCP tool list and session rules: roblox-studio-mcp.
"Field case" = measured in one of the owner's projects; verify on your content.
Traps (symptom -> cause -> fix)
- Flicker where two faces meet -> coplanar overlap; even 0.005 studs apart flickered (field case). Inset one face of each overlapping pair by about 0.01 studs; CSG cutters overshoot the cut surface by about 0.05 per side.
- Hairline gaps between parts -> arbitrary decimals (0.333, 1.17) compounding. Snap sizes and offsets to 0.125/0.25/0.5 and offset sub-parts from an anchor part's CFrame, never from guessed world coordinates.
- Players walk through, get stuck in, or escape the map -> visible mesh used as collision.
CollisionFidelityis never 1:1 (PreciseConvexDecompositionis closest and costliest;Boxis a bounding box,Hullfills cavities). On low-poly mesh maps set meshesCanCollide/CanQueryfalse and put invisible box/wedge Parts under anything sticking out 0.5 studs or more. Walk every gate on the path before handover. - Props slide off shelves or piles collapse seconds after play -> anchored only the base (a quarter of a pile slid, field case). Anchor display props; record what each rests on (an attribute) so breaking the support can release them.
- "No scripts" store pack ships scripts -> descriptions aren't evidence (packs said "No scripts" and held 6-8 scripts plus audio, field case). Read the whole inserted hierarchy and the script flag before play; third-party models can carry backdoors. Paid or cross-owner assets: show creator, ID, price and rights and get consent before
insert_asset. StoreProceduralModels are inserted with their generator module sandboxed. - Gameplay mesh build fails ("EditableMesh budget is full") -> static decor ate the per-device editable budget (eleven decor props broke a core action, field case). Upload meshes that never change; see §2.
- Rotated model "didn't move" ->
Model:GetBoundingBoxis oriented to the pivot. Measure world extents from part corners.CFrame.Angles(0, t, 0).LookVector=(-sin t, 0, -cos t), so a -Z-front model faces +X att = -pi/2. - Props float or sink on smooth terrain -> raycasts miss terrain written the same frame, and the visible surface sat 1-1.5 studs above the written occupancy (field case). Wait a frame, place on a raycast hit, tilt to its normal.
- Room burns white -> lamp pools add up: 32 PointLights at Brightness 1.5 blew a room out; 0.25 with Range 16 read right (field case). Ported lamp data often lists several bulbs per fixture: merge bulbs within ~2 studs. Neon at ordinary bright colours blooms to near-white; keep hue with dark values (45,70,120).
- Roofed interior turns blue or dark ->
ClockTimestill tints fully roofed rooms (14.5 -> 17.4 turned one blue, field case). Leave it; tuneAmbientand oneColorCorrectionEffect. - Metal and smooth surfaces look flat ->
EnvironmentDiffuseScaleandEnvironmentSpecularScaledefault to 0 in the API. Raise them (specular makes smooth objects reflect the sky) and lowerAmbient/OutdoorAmbientto match. ShadowSoftnessdoes nothing -> it applies only withLightingStyle = Realisticand shadow-map-capable devices.- Effect missing in Studio or on phones -> some post effects hide at lower quality levels. Preview at the lowest and highest Editor Quality Level (Studio Settings -> Rendering) before tuning; if raising quality shows more scene, check
StreamingTargetRadiusfirst. - Colour grading change ignored -> only the most recently parented
ColorGradingEffectunderLightingapplies (ignored elsewhere); post effects underCamerashow only to that player.
Limits
| Thing | Value |
|---|---|
| Default avatar | ~5 studs tall, eye ~4.5; door 4x7, path 6+ |
Light Range |
clamped to 120 studs (ExtendLightRangeTo120 is unused) |
| Draw distance at lowest quality | at least 500 studs |
EditableMesh (growable) |
60,000 vertices, 20,000 triangles; a quad counts as 2 |
| Editable meshes per client | ~8 growable at once (field case); 300 fixed-size copies fit |
CreateMeshPartAsync |
~44 ms per call regardless of size; collision rebuild 15-19 ms vs 0.5 ms visual (field case) |
| Mesh map groups | split any group over 20,000 triangles |
| Custom terrain slots | SetMaterialSlot 2-63 (0 Air, 1 Water) |
1. Studio MCP building workflow
Tool map: roblox-studio-mcp.
- Every
execute_luaucall is stateless: re-find the build root at the top of each call. Read positions and sizes back from Workspace; never take coordinates from chat history. - Name the root, origin and dimensions; build one bounded phase at a time and read the target back (bounds, anchoring, collision) before the next. A timeout or
Unknown errormay have run: read back before retrying. - Prefer
search_asset/insert_assetfor common props (store-asset trap above). Generators:generate_procedural_model(primitive-part props, buildings, blockouts; pass meaningfulpartNames; may auto-insert),generate_mesh(one textured mesh; bound size and triangles),generate_material(apply and read back the returned variant name),generate_texture(re-texture a selected mesh),generate_scene(fills a bounding box). If a job ID comes back, callwait_job_finishedbefore dependent edits. - Generated or inserted art is a candidate: look at it from top, bottom and the facing side; triangle counts don't show a wrong shape. Blank texture or invisible mesh: asset privacy grant (
roblox-studio-mcp). - Don't promise a runtime script can repair
MeshId(not script-accessible) orSurfaceAppearanceColorMap(plugin-only); fix at import.MaterialVariant.ColorMapis also plugin-only: keep runtime texture ids in your own data.
2. EditableMesh and EditableImage (field-measured, Studio 2026-11)
- A MeshPart built from an EditableMesh keeps referencing it. After
editableMesh:Destroy(), that MeshPart's mesh reads back 0 vertices. Destroy the mesh only after the MeshPart; displayed meshes keep counting against the budget. - Build growable, then copy fixed-size:
CreateEditableMeshAsync(Content.fromObject(mesh), { FixedSize = true }), then destroy the growable one. Fixed-size allows position/colour edits, not topology;Clear()throws on it. Many MeshParts can share one mesh (CreateMeshPartAsynctwice or:Clone()). AddFace(v1, v2, v3[, v4])takes separate IDs since release 745 (was an array); quads reached live games in 2026-11. UseBatchAdd(Enum.MeshAttribute.X, data)andBatchSetValues(ids, values)for bulk edits; batching cuts call overhead, not limits.- IDs are stable but unordered with holes: iterate
GetVertices()/GetFaces(), never1..count. Re-derive collision once at the end of an edit, not per hit. RaycastLocal(origin, direction)uses the direction's length and hits back faces: start outside, keep hits whose face faces the ray.- A MeshPart stretches its mesh to
Size: after edits setSize = mesh:GetSize()and offset byGetCenter(). Centre fixed-size vertices on the part origin. CreateMeshPartAsyncdefaults to Plastic (grain over vertex colours): useSmoothPlastic. Runtime EditableMesh MeshParts cast no shadow in Studio even withCastShadow = true; check a live client.AssetService:CreateDecalAsynctakes onlyContent.fromObject(editableImage)maps and returns an unparented Decal.PromptCreatePlatformContentAsync(player, image, Enum.AssetType.Image)(server) replaces the removedPromptCreateAssetAsync.- Published games need a 13+ ID-verified creator and "Allow Mesh / Image APIs" on; editables don't replicate.
3. Lighting engine state (creator-docs, 2026-11)
Lighting.Technologyis deprecated and not scriptable (read and write locked; the Future/ShadowMap/Voxel/Compatibility enum remains). Its successors:LightingStyle(RealisticorSoft, the flat retro look) andPrioritizeLightingQuality(truekeeps shadows and shaders up close as quality drops,falsekeeps view distance). The shadow path depends on both:SoftwithPrioritizeLightingQualityuses shadow maps, not voxel lighting. API metadata lists both as script-writable while the light-sources guide says Properties window only: set them in Studio and test before switching at runtime. Check on a phone at low quality.- Atmosphere vs sky: a low
Offsetlets the skybox show through objects and terrain; balance it againstDensity, which also hides the sky seen through geometry. ColorGradingEffect.TonemapperPreset:Retromimics pre-2019 lighting and washes out light colours (field case); exposure changes did nothing while grading was on.- Decal/Texture emissive mask:
EmissiveMaskContent,EmissiveStrength(0 off, high values clamp to white) andEmissiveTintmake a decal glow without a light. Sky.SkyboxLffaced +X andSkyboxRt-X in one project (field case): verify generated faces with a direction-grid debug render.Expanded Terrain(per place, off by default) gives up to 62 custom terrain materials throughTerrain:SetMaterialSlot; a deleted in-use material paints terrain purple, and terrain thinner than 16 voxels can vanish on clients with a small streaming radius.
