Builtin Library
README.md
ecs.WheelCollider
Spec for the WheelCollider component, which maps to the native WheelCollider. A raycast-based wheel that applies a suspension spring, motor/brake torque, and tire friction to the parent rigid body.
Fields
suspensionDistance— suspension travel.springRate,damperRate— suspension spring stiffness and damping.targetPosition— rest position along the suspension travel.radius,width— wheel dimensions.motorTorque,brakeTorque— drive and braking torque.maxDriveSpeed— the tread speed (m/s) up to whichmotorTorquedrives a wheel with aninertia; 0 for none.steerAngle— steering angle.forwardFriction,sidewaysFriction— tire grip along and across the wheel.rollingResistance— rolling drag.surfaceGrip:{ { surface, grip } }, the share of its stated grip the tyre grips a surface (by name or tag) with, in place of the surface's friction;gripis 1 when an entry states none.surface,ground(runtime): the surface the tyre touches and the entity id of what it touches.is2D— constrain the wheel to a 2D plane.
entity(id).component.add("WheelCollider", { radius = 0.35, springRate = 35000, motorTorque = 200 })