Key and Lock Door
A colour-coded key pickup and its locked door: a big game key (0.8 m, pickup scale) that spins about y (part key), and a stone door frame 2 m wide, 3 m tall and 1 m deep holding a banded gate with a padlock in the same colour. The gate (part gate) is hinged on the left post and swings inward (-Z) to open. Show both, only the key, or only the door.
- Size
- 2.1 × 3.0 × 2.2 m
- Triangles
- 752
- Kit
- Platformer
Tune it
4 knobs: Piece, Colour, Open, Frame.
Specs
- Size
- 2.1 × 3.0 × 2.2 m width × height × depth
- Triangles
- 752 of 6,000
- Draw calls
- 1 one vertex-colour material
- Loop clip
- 8 m of travel per cycle
- Moving parts
- 2 gate · rotate, key · spin
- Knobs
- 4 3 presets
- Night lights
- 1 glow
Passed the validator: real scale, rests on y = 0, front faces +Z, deterministic.
Use it
Code for the specimen as it is set up above; it follows your knobs.
import { createAsset } from 'https://gaitkit.com/cdn/key-and-lock.mjs';
const keyAndLock = createAsset();
scene.add(keyAndLock); // rests on y = 0, front faces +Z
// 'gate' pivots on its hinge: -100° to 0° around y
keyAndLock.getObjectByName('gate').rotation.y = THREE.MathUtils.degToRad(-100);import { useMemo } from 'react';
import { createAsset } from 'https://gaitkit.com/cdn/key-and-lock.mjs';
export function KeyAndLock() {
const model = useMemo(() => createAsset(), []);
return <primitive object={model} />;
}# Import key-and-lock.glb (download below). Moving parts are separate nodes, pivoted on their hinge.
$KeyAndLock/gate.rotation_degrees.y = -100// Import key-and-lock.glb with glTFast (com.unity.cloud.gltfast).
transform.Find("gate").localEulerAngles = new Vector3(/* y: */ -100, 0, 0);Use the gaitkit MCP server: get_variant({ "id": "key-and-lock", "want": "default look" })
then place the result.
# MCP endpoint
https://gaitkit.com/mcpKnobs
| Knob | Type | Values | Default | What it does |
|---|---|---|---|---|
piece | choice | both key door | both | both (the door with its key floating 1.6 m in front of it), key (the key pickup on its own), door (the locked door on its own, a 2 x 1 grid piece). |
color | choice | gold silver red blue green | gold | Colour shared by the key and its lock, so players match them: gold, silver, red, blue or green. |
open | range | 0 to 1, step 0.05 | 0 | How far the gate has swung open, inward away from the viewer. 0 locked shut, 1 fully open (100 degrees). |
frame | choice | stone wood | stone | stone (castle blocks with a lintel) or wood (heavy timber posts and beam, for a mine or a forest hut). |
Presets: red key door {"color":"red"} · blue key {"piece":"key","color":"blue"} · opened gate {"piece":"door","open":1,"color":"green","frame":"wood"}
Files
| File | What |
|---|---|
| key-and-lock.glb | GLB, default look · 104 KB |
| key-and-lock.mjs | ES module, every knob live |
| key-and-lock.obj | OBJ, static, no colour |
| key-and-lock-params.json | knob schema, presets, night zones |
Licence
Use it in games, apps, renders and client work, commercially and without credit. Do not resell it as an asset or train a 3D generator on it. The full licence.