/ls-clad:physicsfrom ls-clad
Builds and debugs Lens Studio physics including gravity, collisions, joints, raycast input, trigger zones, and force-driven motion. Activates when working with BodyComponent, ColliderComponent, ConstraintComponent, WorldComponent, or Physics API calls in .esproj files.
Ships in ls-clad. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Three-layer model — skipping a layer is where most bugs come from.
WorldSettingsAsset.Physics.getRootWorldSettings() returns null until you create your own WorldSettingsAsset and assign it on the Scene asset's physicsRootSettings field. Writes to the implicit default silently no-op.y = 0, enabled by default on the root world. Disable it (Scene > Physics) when you need custom floor geometry or want to drop below y = 0. Custom WorldComponent worlds do not inherit it.Physics.WorldComponent. Character Controller projects are limited to a single WorldComponent.Physics.ColliderComponent = static / trigger. Physics.BodyComponent extends Collider with a dynamic flag plus mass/density/damping. Body { dynamic: false } ≡ a Collider — prefer ColliderComponent for static intent; it reads cleaner and skips the mass/damping fields.BodyComponent; each child SceneObject owns a ColliderComponent with its own shape. The whole assembly tumbles as one rigid body. forceCompound: bool on a child controls whether raycasts return the leaf or the parent.*PhysicsObjectPreset (Box / Sphere / Capsule / Cone / Cylinder). Comes wired with mesh + body + matching shape. For purely static visuals, use the non-physics counterparts (BoxMeshObjectPreset …) and add a ColliderComponent — clearer intent than dropping a physics preset and flipping dynamic = false.BodyComponent / ColliderComponent, pick a shape, size to match. Off-center pivots need a pivot-wrapper — a body rotates around the SceneObject pivot, not the mesh center. Pin authored with pivot-at-base spins sideways instead of toppling. See references/api-surface.md § Fitting.ColliderComponent only (dynamic skinned bodies are unsupported). Set both shape.mesh and shape.skin — without skin the collider freezes at the bind pose. Hollow + no CCD → fast bodies tunnel; raise simulationRate or use a primitive on the dynamic side.debugDrawEnabled = true while authoring. The cyan wireframe is the only way to see whether a collider matches the visual.Physics.ConstraintComponent on a child of a body. Types: Fixed / Point / Hinge. target = another body/collider, or null to anchor to world.target to move the joint.references/gotchas.md § Hinge axis defaults to local Y for the rotation recipe and code example.body.addPointConstraint / addFixedConstraint / addHingeConstraint, paired with removeConstraint) — pick by lifetime. Ad-hoc is the canonical form for grab/throw/break interactions.worldSettings.simulationRate (default 60, valid 30–240 step 30) to 120/240, or set absoluteSpeedLimit / relativeSpeedLimit.(0, -980, 0) cm/s². Right-handed coordinate system: +X cross +Y gives +Z. The vec3 constant forward is defined as (0, 0, 1) (+Z).shape.convex = true is required on dynamic bodies (engine bakes a convex hull; concavity collapses). For concave dynamic geometry, use a compound of primitives. Mesh-vs-mesh is the most expensive contact pair.fitVisual only works on Box and Sphere — Capsule/Cylinder/Cone/Mesh silently ignore it. Plane.mesh has 0 thickness on Y, so fitVisual on a flat floor produces a zero-thickness slab that bodies fall through. Static floors/walls need ≥ 20 cm explicit thickness on the contact axis.matter assigned.includeIntangible defaults to false — triggers don't detect other triggers unless explicitly opted in.| Behavior helper | Script |
|---|---|
Trigger is a Physics Collider Event, response is a stock action (Play Sound, Set Color, Spawn Prefab, Apply Force, Send Custom Trigger) | Need raycasts, dynamic spawning, math on contact normals, conditional logic on impulse |
| Purely declarative (event → action) | Read/write velocity / angularVelocity, apply mass-aware impulses, per-frame UpdateEvent loop |
Bridge: global.behaviorSystem.sendCustomTrigger('name') ↔ addCustomTriggerResponse('name', cb).
Physics Collider Event has its own Static / Dynamic / Intangible filter checkboxes — set them on the trigger, not on the body.
Physics.ColliderComponent will accept a LevelSet shape but rigid bodies won't collide with it.WorldComponent.references/api-surface.md.Editor.Shape.create*Shape(scene) patterns): references/api-surface.md § Fitting.references/gotchas.md.references/patterns.md.references/draggable-pattern.md.editor-api-specialist): references/mcp-workflow.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
74 skills in this plugin
/build-imageGenerate a 2D image from a text prompt via SPECS text-to-image, to Assets/GeneratedImages/<Name>.png (build-mesh reference, texture, or screen-space). Transparent RGBA cutout, cropped tight, by default; opt out for an opaque image.
/build-meshGenerate a 3D mesh, model, or asset for a Lens — build, create, or make props, characters, scenery. Four peer backends chosen per asset: SPECS text-to-3D (static default — best texture fidelity, async minutes-long jobs), FAST3D (faster static AI props), code-authored MeshBuilder via the mesh-builder-scripting skill (articulated, animated, parametric TypeScript content), and Blender voxel (blocky aesthetic; the only source of rigged GLBs). GLB backends return the file plus AABB metadata so the caller can size colliders and place the mesh in the world.
/build-musicGenerate musical phrases, chord progressions, beats, jingles, and short pieces via local algorithmic synthesis. Sample-free, license-clean, fully offline. Scale-degree composition, pattern-based arrangement, frequency-separated mixing rules. Outputs 44.1 kHz stereo WAV to Assets/GeneratedSFX/./build-sfxGenerate non-pitched sound effects (UI, impacts, sweeps, foley, ambient textures, retro 8-bit) via local algorithmic synthesis. Outputs 44.1 kHz WAV to Assets/GeneratedSFX/. For musical phrases or chord progressions use /build-music instead./camera-and-renderingCamera configuration, 2D/screen-space rendering, RenderMeshVisual patterns, and visibility debugging for Lens Studio scene construction. Use when setting up cameras (orthographic/perspective), creating screen-space content (ScreenTransform, Image, Text), debugging invisible objects, or planning any scene involving rendering config./editor-apiExecuteEditorCode contract and Editor API paradigms — runtime, access patterns, gotchas, references. Use before writing Editor API TS (`pluginSystem.findInterface`, `LensStudio:*`), grepping `editor.d.ts`, or routing to scene/asset-graphql.npx claudepluginhub lens-studio-devs/ls-extensions --plugin ls-cladOther plugins' skills for the same job