Vehicle tools
For creatorsAdd-on 2.2.2+
A vehicle’s tool is a set of moving parts the driver works from the seat: a forklift’s mast, its forks and its tilt. Each part is solid and pushes what it meets, and forks pick up loads that are physics objects of their own. The forklift is the worked example on this page, with pallets, a rack and the pick, carry and place loop a game can build on.
▶ Drive the forklift: walk to it and press E. Hold K and the forks rise, then halt at pallet height. Let go and hold K again to go on up. J lowers them. , tilts the mast back and . tilts it forward. The rear wheels steer, so right still turns right.
Give a vehicle a tool
Section titled “Give a vehicle a tool”- Make the vehicle first (make a vehicle). For a forklift, pick the Handling preset
forklift: 3.5 t, 25 km/h, front-wheel drive, a rear axle that steers. - Make each moving part its own object under the vehicle, with its origin on the axis it moves along or turns about. The pose it has
in Blender is the value you give it as
param.valuein step 4. - Select the vehicle. In Properties ▸ Object ▸ Simulacrum, choose Add Component ▸ Machines ▸ Machine. Add the tag
vehicle.tool(Tags ▸ Add Tag) and set it to the name of the main moving part’s parameter (for exampleheight). - Select each moving part and choose Add Component ▸ Machines ▸ Parameter. Set its name, how it moves (
param.drive,param.axis), its range (param.min,param.max) and the value its pose is at now (param.value). - On the part that picks things up (the forks), add
tool.grab = forksandtool.shape = fork. - Press Play. Get in and work each part with its two keys.
A part that should move with another without its own keys, such as an inner mast, is a follower: param.follow, below.
The driver’s controls
Section titled “The driver’s controls”Every parameter that follows nothing becomes a pair of keys while you drive: hold one to lower it (or tilt it back), the other to raise
it. Keys come from the part’s param.keys, else from this order:
| Part | Keys |
|---|---|
| The first | J lower · K raise |
| The second | , · . |
| The third | ; · ’ |
| The fourth | [ · ] |
Players can rebind them on the system menu’s Controls page. By default they have no gamepad, headset or phone binding.
- Stops. A held key carrying a part through one of its
param.stopshalts there. Let go and press again to go on. The forklift stops at pallet-entry height and at level. - The floor. The forks stop 1 mm above whatever is under them, so a lift lowers onto the floor and a forward tilt stops with the tips on the ground.
- The assist. With no tool key held, driving up to a pallet that says where its openings are (
load.entry, below), the forks move to the middle of the opening and the mast toward level, as a driver’s hands would. Your keys always win. Add&forksAssist=0to the scene’s address to turn it off. - The seat. With the forks inside a pallet, the truck brakes so it stops as the pallet meets the fork face.
- In a shared room, every player sees the main part (
vehicle.tool) where the driver holds it.
Settings
Section titled “Settings”On the vehicle:
| Tag | Values | What it does |
|---|---|---|
pc.machine |
1 |
The vehicle is a machine too (the Machine component writes it) |
vehicle.tool |
a parameter’s name | The main moving part. Default: the first parameter that follows nothing |
vehicle.steer.axle |
front · rear · both |
Which axle steers (the forklift preset writes rear) |
On each moving part (the Parameter component writes the pc.param and param.* tags):
| Tag | Values | What it does |
|---|---|---|
param.name |
text | The part’s name, and the name of its control |
param.drive · param.axis |
rotate · translate · x y z |
Degrees about, or metres along, the part’s own axis in Blender |
param.min · param.max · param.value |
numbers | Its range, and the value its modelled pose is at |
param.rate |
units a second | How fast a held key moves it. Default: a quarter of its range a second |
param.keys |
two key names, KeyJ,KeyK |
Its lower and raise keys, by the browser’s key names |
param.stops |
v1,v2,… |
Values a held key halts at |
param.follow |
another parameter’s name | A follower: it rides along, covering its own range as the leader travels, and has no keys |
param.follow.from |
a value of the leader | The follower starts once the leader passes this value (a mast’s free lift) |
tool.shape |
box (default) · fork · none |
Its solid shape: one box over its mesh, two thin blades and a backrest, or none |
tool.grab |
forks |
This part picks up loads |
Collision pieces under a moving part (mesh children whose names start with UCX_) replace tool.shape with exactly the shapes you
model. On the grabbing part, pieces whose names contain blade are the blades.
A rigged vehicle
Section titled “A rigged vehicle”The vehicle can be an armature instead. Each bone is a joint, and a pose bone’s custom properties are its tags. A Limit Location constraint (local, one free axis) or a Limit Rotation constraint (local, one axis) gives the bone its drive, axis and range, and its pose gives its value. A mesh parented to a bone rides it rigidly; a skinned mesh does not bend.
Loads and racks
Section titled “Loads and racks”A load is a prop the tool can pick up: a physics object of its own, never fixed scenery.
| Tag | On | Values | What it does |
|---|---|---|---|
load |
a prop | pallet · box |
Makes it a load |
load.mass |
a load | kg | Its mass. Default 35 for a pallet, 100 for a box |
load.boxes |
a load | cx cy cz hx hy hz;… |
Its collision as boxes in its own frame, y up, in metres: each box’s centre and half-sizes |
load.entry |
a load | x or z, then y0 y1 |
The axis the forks go in along, and the height band of its opening |
load.openings |
a load | x0 x1;… |
Its openings across that axis |
load.sku |
a load | text | Which cargo child it shows |
load.stowed |
a load | 1 |
It starts out of play: hidden and not solid |
cargo |
a child of a load | a name | Shown while the load’s load.sku matches |
rack.slots |
a rack | id x y z;… |
The slots: where a load’s base centre sits, in the rack’s own frame with y up |
Without load.boxes, a pallet is guessed from its size as a deck on three runners, and a box as one block. Give a real pallet its
boxes: guessed, its outer runners can stand in the forks’ way.
Pick, carry and place
Section titled “Pick, carry and place”- Pick. A load resting on the blades while they rise is picked up. It rides the forks rigidly, and its weight is added to the truck’s: a heavy load held high leans the truck in a turn.
- Set down. Lowering the forks with the load just above a surface puts it down.
- Place. A load set down within 12 cm of a rack’s slot, and within 4 cm of its height, counts as placed in that slot once it comes to rest.
Game logic
Section titled “Game logic”A behaviour graph’s On Message hears every move of a load (game logic):
| Message | Carries |
|---|---|
world:load.picked |
The load’s name |
world:load.set |
The load’s name |
world:load.placed |
<load>@<rack>.<slot>, for example [email protected] |
Call Component on a load (its name as the target) takes reset (back where the scene put it), slot (the slot it is in),
carried, put (into <rack>.<slot>) and stow (out of play). A challenge such as “pick the pallet up and place it in the free slot”
needs nothing more: start a timer on world:load.picked and stop it on the world:load.placed you want.
Workplaces runs a whole warehouse on these loads.
Props that only ride along
Section titled “Props that only ride along”A prop tagged plot.carried = <the vehicle's name> and plot.carried.part = <a moving part's name> hangs on that part and moves with
it, as looks only. It never collides and is never picked up. For physics, tag it load instead.
Limits
Section titled “Limits”- One tool vehicle a scene. Each vehicle with a tool takes every load in the scene as its own.
- Only forks grab.
tool.grab = forksis the one way to pick things up. Other parts are solid but pick nothing up. - Loads are not shared. In a shared room, other players see the forks move, not the load riding on them.
- Tool keys are keyboard keys until a player binds a pad or controller on the Controls page.
- The fourth part’s keys move the seat. [ and ] also move the driver’s seat in the seat view, so give a
fourth part its own
param.keys. - It can tip. The mass is real: a heavy load far out on the forks pitches the truck forward, and full lock at a jogging pace can roll it over, even empty.
- Doors are never the tool. A door made a moving part (moving parts) swings as the driver gets in and out, and is never worked from the seat.