Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 07158574-5…

WheelCollider

Raycast-based wheel collider (Unity-style). Add to a child entity of a rigid body; the system finds the nearest ancestor with a `Physics` component and applies suspension, drive, and friction forces to it.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

WheelCollider

Raycast-based wheel collider (Unity-style). Add to a child entity of a rigid body; the system finds the nearest ancestor with a Physics component and applies suspension, drive, and friction forces to it.

Drive conventions: positive motorTorque drives toward the parent body's local -Z (the engine's forward); positive steerAngle steers right.

Suspension springRate/damperRate are clamped per step to what the chassis mass can integrate stably, so an over-stiff spring on a light body settles instead of oscillating — tune rates to the vehicle's mass for the intended feel.

Public fields: suspensionDistance, springRate, damperRate, targetPosition, radius, width, motorTorque, brakeTorque, steerAngle, forwardFriction, sidewaysFriction, rollingResistance, is2D. Runtime-read-only (updated every physics tick): isGrounded, compression, angularVelocity — also readable via Physics.getWheelState(wheelId).

Methods: setMotor(torque), setBrake(torque), setSteer(angle).

entity(wheelId).component.add("WheelCollider", {
    radius = 0.3,
    suspensionDistance = 0.3,
    springRate = 35000,
    damperRate = 4500,
})

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

WheelCollider Component Raycast-based wheel collider (Unity-style). Add to a child entity of a rigid body. The system automatically finds the nearest ancestor with a Physics component and applies suspension/drive/friction forces to it. Drive conventions: positive `motorTorque` drives toward the parent body's local -Z (the engine's forward); positive `steerAngle` steers right. Config is the native WheelCollider ECS component, driven through the typed ecs.WheelCollider API. Usage: local car = entity.spawn({ name = "car" }) car.component.add("Model", { model = "cube" }) car.component.add("Physics", { kind = "dynamic" }) car.position = { 0, 2, 0 } local wheel = entity.spawn("wheel_fl", { parent = car.id }) wheel.localPosition = { -0.8, -0.3, 1.2 } -- local offset from car wheel.component.add("WheelCollider", { suspensionDistance = 0.3, springRate = 35000, damperRate = 4500, }) The radius comes from the wheel entity's own model bounds unless it is set, so a wheel with a wheel mesh needs no radius at all: wheel.component.add("WheelCollider", { radius = 0.3 }) -- authored wheel.component.add("WheelCollider", {}) -- fits the mesh Control at runtime: wheel.component.get("WheelCollider").motorTorque = 500 entity(wheel).component.get("WheelCollider").steerAngle = 15 Read contact state at runtime: wheel.component.get("WheelCollider").isGrounded wheel.component.get("WheelCollider").compression

wheelState( ) → void

Read-only runtime state the wheel system writes after each physics step. Computed rather than stored: the value is read straight from the native component at the moment it is asked for, so a wheel costs nothing between reads. Per-peer simulation state, recomputed locally on every peer.

wheelValue( ) → void

Build the typed ecs.WheelCollider value from the config public fields.

awake( ) → void

onPropertyChanged(key: ?, value: ?, oldValue: ?) → void

argtypedescription
key?
value?
oldValue?

onDestroy( ) → void

setMotor(torque: number) → void

Set this wheel's motor torque (positive = drive forward). Equivalent to assigning to `motorTorque` directly — both routes hit the same reactive `ecs.set` path.

argtypedescription
torquenumberMotor torque in N·m. Use 0 to disengage.

examples

wheel:setMotor(500)

setBrake(torque: number) → void

Set this wheel's brake torque (always positive — magnitude only).

argtypedescription
torquenumberBrake torque in N·m. Use 0 to release.

examples

wheel:setBrake(800)

setSteer(angle: number) → void

Set this wheel's steering angle (rotates the wheel about its vertical axis, used for front-axle steering).

argtypedescription
anglenumberSteering angle in degrees, positive = right.

examples

wheel:setSteer(15)

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
·
other · born here
▤file
▲ 0↑ born
backing path · components/WheelCollider.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.