How to Build a Working Car in Roblox

TIME : 2016-01-07
How to Build a Working Car in Roblox

Building a drivable car in Roblox comes down to four things: a body, joints, motors, and a script. The building is quick; the scripting is where the time goes.

Construction

  1. Make two square parts and attach them together. This is the body.
  2. Add a joint on each side of the front square — not the front face, the sides.
  3. Add a motor joint on each side of the rear square.
  4. Create four wheels.
  5. Attach one wheel to each joint and motor. Joints should meet a flat side of the wheel, not the tread.
  6. Place a seat on top of the front square. This is the driver's seat.

The script

Open the script editor and define the following behaviour:

  • When the seat is occupied, the occupant controls that car's motors.
  • Up arrow — both motors accelerate forward.
  • Left arrow — right motor reverses, left motor accelerates forward.
  • Right arrow — right motor forward, left motor reverses.
  • Down arrow — both motors reverse.

You also need to tell the script which objects are which: this is the driver seat, this is the left motor, this is the right motor. Then define rotation direction — left motor forward is counter-clockwise, right motor forward is clockwise, and both reverse the other way.

Why differential steering works

Opposing motor directions on the two sides is how a skid-steer vehicle turns, the same principle as a tank or a differential-drive robot. It is simpler than a steering rack and behaves well in a physics sandbox.

Optional: add a passenger seat on top of the rear block. If any of the scripting is unfamiliar, the Roblox wiki is genuinely the best reference — it is maintained by the community and covers exactly this build step by step.