Module · Building
kinetics
Axles, gear teeth and meshes: make parts of creations turn, mesh and drive each other. Reading needs "building"; making and driving needs "building.kinetics" (server).
kinetics.available(): boolean
True when gears simulate right now. When the game runs without gear simulation, gears are still drawn but do not turn.
kinetics.gear(block: Block, options?: any): Gear
Puts teeth on a block. Options: shaft (it turns with it; leave out to fix it to the block's part), kind ("circle", "line" for a rack, "screw" for a worm), centre (cells), axis (a circle's axis, a rack's travel, a worm's axis), normal (rack: toward its gear), reference (tooth zero), radius (m) or teeth + module (m, default 0.025), lead (worm, m per turn), internal (ring gear), extent (face width / rack length, m), strength (N), friction.
local teeth = kinetics.gear(block, { shaft = shaft, teeth = 32, axis = "+y" })kinetics.gearsOn(block: Block): Gear[]
The teeth on a block: a gear block's own, and any mods put there.
kinetics.mesh(a: Gear, b: Gear, options?: any): GearMesh
Meshes two gears: their teeth drive each other at the ratio their sizes give, wherever they are. Options: strength (N before teeth jump), friction, engage (m they may drift apart and stay meshed; 0 = always).
kinetics.mesh(teeth, kinetics.gearsOn(otherGear)[1])kinetics.onTeethJumped(fn: function): Subscription
Calls fn(mesh, teeth) when teeth jump in a mesh — overloaded, or torn apart and re-seated.
kinetics.onTeethJumped(function(mesh, teeth) effects.burst("sparks", mesh.a.block.position) end)kinetics.rpm(block: Block): number
How fast a block's spinning parts turn relative to its part, in turns per minute — on any machine, including clients.
kinetics.shaft(block: Block, options?: any): Shaft
Gives a block an axle: it turns about axis (block-local, like "+z") through pivot (block-local cells) relative to its part. Options: axis, pivot, friction (N·m), damping, inertia (kg·m²), gyroscopic.
local shaft = kinetics.shaft(block, { axis = "+y", friction = 0.5 })
shaft:motor(30, 400)kinetics.shaftOf(block: Block): Shaft?
The shaft a block turns with — yours, another mod's or a gear block's own — or nil.
kinetics.spin(block: Block): number
How far a block's spinning parts are drawn turned right now, in degrees (-180..180) — on any machine, including clients.
kinetics.stats(): any
Counts, for profiling: { shafts, gears, meshes, trains, networks, gearBlocks }.