PcoWSkbVqDnWTu_dm2ix

Vehicles Kit

Vehicles Kit

20 min

To help you create exciting driving, racing, and flying experiences, several endorsed vehicles are available for use in any game. All vehicles are entirely constraint-based and drive using real physics.

To use an endorsed vehicle in your game:

  1. Select one of the following:
  1. On the vehicle’s item page, click the green Get button and confirm the transaction.
  2. In Roblox Studio, open the toolbox (ViewToolbox).
  3. Select your toolbox Inventory section.
  1. Locate the vehicle and click it to add it into the place.

Vehicle Structure

Each endorsed vehicle is structured as follows, but note that its model may not contain all objects listed.

[Vehicle] (Model)
Animations (Folder) — Storage for animation assets used when sitting in the vehicle.
Configuration (Folder) — Holds configuration items for the vehicle. Note that each vehicle does not necessarily contain all of these properties.
Ground Vehicles and Helicopter
BrakingTorque (NumberValue) — Factor of torque applied when using the brake, or switching between forward and reverse. Higher value means faster braking.
DrivingTorque (NumberValue) — Factor of torque applied when accelerating; sets the CylindricalConstraint/MotorMaxTorque|MotorMaxTorque property on all CylindricalConstraint|CylindricalConstraints. Higher value means faster acceleration.
MaxSpeed (NumberValue) — The vehicle's highest speed while moving forward.
MaxSteer (NumberValue) — Limits the range the steering PrismaticConstraint can move side to side. Lower values mean less sharp turning ability.
ReverseSpeed (NumberValue) — The vehicle's highest speed while moving in reverse.
StrutSpringDampingFront (NumberValue) — The damping value for the front strut SpringConstraint|SpringConstraints.
StrutSpringDampingRear (NumberValue) — The damping value for the rear strut SpringConstraint|SpringConstraints.
StrutSpringStiffnessFront (NumberValue) — The stiffness value for the front strut SpringConstraint|SpringConstraints.
StrutSpringStiffnessRear (NumberValue) — The stiffness value for the rear strut SpringConstraint|SpringConstraints.
TakeOffAccessories (BoolValue) — If true, the player's RightFoot, RightLowerLeg, LeftFoot, and LeftLowerLeg will become fully transparent upon entering the vehicle, as well as any accessories associated with BodyBackAttachment, WaistBackAttachment, and HatAttachment.
TorsionSpringDamping (NumberValue) — The damping value for all four torsion bar SpringConstraint|SpringConstraints.
TorsionSpringStiffness (NumberValue) — The stiffness value for all four torsion bar SpringConstraint|SpringConstraints.
WheelFriction (NumberValue) — If included, overrides the default value for wheel friction.
Plane
AngleOfAttack (NumberValue) — Multiplier for the force which helps the plane ascend while traveling through the air. The force is affected by likeness of heading vector to velocity vector, along with the square of the plane's velocity, and is then multiplied by this value.
BaseThrottle (NumberValue) — The force from the engine that is applied to the plane.
Drag (NumberValue) — Coefficient of drag. Force is proportional to the square of the plane's velocity.
Lift (NumberValue) — Coefficient of lift. Force is proportional to the square of the plane's forward velocity.
PitchSpeed (NumberValue) — Multiplier to the base pitch speed. Base speed is determined by likeness of the velocity vector to the plane's forward vector.
RollSpeed (NumberValue) — Multiplier to the base roll speed. Unlike PitchSpeed, this is not bound to vector likeness.
TakeOffAccessories (BoolValue) — If true, the player's RightFoot, RightLowerLeg, LeftFoot, and LeftLowerLeg will become fully transparent upon entering the plane, as well as any accessories associated with BodyBackAttachment, WaistBackAttachment, and HatAttachment.
Torque (NumberValue) — Rotational multiplier to the drag force that sets the power of pitch/yaw/roll. Lower values mean less inertia for planes to turn, while higher values mean more inertia or "snappier" turns. If this value is too low given the plane's weight, turning speeds may be affected.
YawSpeed (NumberValue) — Multiplier to the base yaw speed. Like PitchSpeed, base speed is determined by likeness of the velocity vector to the plane's forward vector.
Constraints (Folder) — Contains the physical constraints that drive the vehicle chassis.
Effects (Folder) — Storage for Sound|Sounds, ParticleEmitter|ParticleEmitters, Trail|Trails, and other effects.
Remotes (Folder) — Storage for remote events and functions that handle seating.
Scripts (Folder)
Vehicle (Script) — Handles the following:
  • Ensures that upon joining the game, players get a copy of the SeatLocatorScreenGui and the SeatLocator scripts in their PlayerGui.
  • Performs the process noted in TakeOffAccessories above.
  • When a player enters a vehicle, gives that player the ScreenGui (VehicleGui) which displays driving controls.
  • Registers the driver seat and passenger seats with the VehicleSeating module script.
Driver (LocalScript) — This is passed to the player when entering the driver seat. It interprets input to perform actions on the vehicle including driving and entering/exiting. This script also configures the camera and calls functions from the Chassis script to update constraints every frame based on input.
Passenger (LocalScript) — This is passed to the player when entering a passenger seat. Interprets input for entering and exiting the car only. Also configures the camera for passengers.
SeatLocator (LocalScript) — Works along with other scripts in the seating and prompt system.
Chassis (ModuleScript) — The only script that interfaces directly with constraint objects in the Constraints folder. Constraint values are initialized based on the current gravity setting and configuration values set in the Configuration folder.
Effects (ModuleScript) — Manages the vehicle effects stored in the Effects folder.
InputImageLibrary (ModuleScript) — Along with its children, this handles on-screen GUI images for various gamepad inputs.
Keymap (ModuleScript) — Used to define key/button to action mappings. Each entry inside an action is a separate dictionary that needs a enum/KeyCode|KeyCode for the key/gamepad button pressed, along with an axis for an analog input. Note that actions defined here must be implemented in the Driver or Passenger scripts.
LocalVehicleGui (ModuleScript) — Contains the VehicleGui ScreenGui which displays on-screen vehicle controls/info.
LocalVehicleSeating (LocalScript) — Works along with other scripts in the seating and prompt system.
VehicleSeating (ModuleScript) — Works along with other scripts in the seating and prompt system.
Body (Model) — Contains all of the non-essential mesh and decoration parts that make up the visual appearance of the vehicle. These can be removed or customized, but note the density distributions below.
Chassis (Model) — This is the functional part of the vehicle that handles driving. Contains all of the chassis parts that are connected to physical constraints, seat parts, and weights to balance the front and rear of the vehicle. The chassis is tuned to work with default Workspace/Gravity|Gravity of 35 and will also work well with the "Action" gravity setting of 75, but if a game uses extreme gravity settings, additional tweaks may be necessary for the chassis to work well.

Seating & Prompt System

Every vehicle can have one driver’s seat and, optionally, as many passenger seats as you want.

  • The driver’s seat must be a VehicleSeat object named VehicleSeat. This should be a direct child of the vehicle’s Chassis model, positioned exactly where you want the driver to sit. Do not add more than one driver’s seat.

  • Passenger seats must be Seat objects and each seat should be a uniquely named child of the Chassis model. Additionally, in the Scripts/Chassis ModuleScript, add each passenger seat to the Chassis.passengerSeats array as follows, where [SeatName] is the name of the Seat object:

Internally, the seating/prompt system is handled by the three highlighted scripts:

Scripts (Folder)
Vehicle (Script)
Driver (LocalScript)
Passenger (LocalScript)
SeatLocator (LocalScript)
  • Finds the closest seat to the player at a set interval of 0.1 seconds (this can be altered by changing the SEAT_POLL_INTERVAL constant at the top of the script).
  • Tells the LocalVehicleSeating script to show the prompt to enter the seat each time a new seat becomes closest to the player.
Chassis (ModuleScript)
Effects (ModuleScript)
InputImageLibrary (ModuleScript)
Keymap (ModuleScript)
LocalVehicleGui (ModuleScript)
LocalVehicleSeating (LocalScript)
  • Houses the ShowPrompt() function which, if the player is close enough to the closest seat, will show the icon to enter the driver/passenger seat, or it will show the flip icon if the vehicle is flipped over. You may change the MIN_FLIP_ANGLE constant at the top of this script to change how many degrees the vehicle must be turned over to be considered flipped.
  • Listens to player input and responds appropriately, changing which icons are displayed on prompts to enter/flip the vehicle depending on the last input type (keyboard, gamepad, touch). If a player activates the currently displayed prompt by entering the correct input, this file will tell the server what to do and play the appropriate animation for the player if they enter the vehicle.
VehicleSeating (ModuleScript)
  • Handles snapping a player in and out of seats when they enter/leave a vehicle.
  • Makes the doors swing open and closed.
  • Registers the FlipSeat remote event's RemoteEvent/OnServerEvent|OnServerEvent callback which tells the chassis to flip the car over when the player triggers it.

Vehicle Controls

Ground Vehicles
Action Key / Control
Accelerate / Forward W or
Brake / Reverse S or
Turn Left A or
Turn Right D or
E-Brake / Drift Spacebar
Enter / Exit / Flip E
Helicopter
Action Key / Control
Steer Move mouse (camera control)
Accelerate / Forward W or
Decelerate / Backward S or
Strafe Left A or
Strafe Right D or
Hover Up Q or Shift
Hover Down Z or Ctrl
Enter / Exit / Flip E
Plane
Action Key / Control
Steer Move mouse (camera control)
Accelerate / Forward W or
Decelerate / Stop S or
Roll Left A or
Roll Right D or
Enter / Exit / Flip E
Ground Vehicles
Action Button / Control
Accelerate / Forward Jump button (changes visually)
Brake / Reverse Smaller button to left of accelerate button
Turn Left/Right Move thumbstick
E-Brake / Drift Occurs at maximum turn
Enter / Flip Button prompt above vehicle
Exit Smaller button above accelerate button
Helicopter
Action Button / Control
Steer Touchscreen (camera control)
Accelerate / Forward Move thumbstick forward
Decelerate / Backward Move thumbstick back
Strafe Left/Right Move thumbstick left/right
Hover Up Jump button (changes visually)
Hover Down Smaller button to left of hover up button
Enter / Flip Button prompt above helicopter
Exit Smaller button above hover up button
Plane
Action Button / Control
Steer Move thumbstick
Accelerate / Forward Jump button (changes visually)
Decelerate / Stop Smaller button to left of accelerate button
Enter / Flip Button prompt above plane
Exit Smaller button above accelerate button
Ground Vehicles
Action Button / Control
Accelerate / Forward Right trigger
Brake / Reverse Left trigger
Turn Left/Right Move left analog stick left/right
E-Brake / Drift
X
Enter / Exit / Flip
Y
Helicopter
Action Button / Control
Steer Right analog stick (camera control)
Accelerate / Forward Move left analog stick forward
Decelerate / Backward Move left analog stick back
Strafe Left/Right Move left analog stick left/right
Hover Up Right trigger
Hover Down Left trigger
Enter / Exit / Flip
Y
Plane
Action Button / Control
Steer Right analog stick (camera control)
Accelerate / Forward Right trigger
Decelerate / Stop Left trigger
Roll Left/Right Move left analog stick left/right
Enter / Exit / Flip
Y
Tags:
  • vehicle
  • car
  • truck
  • motorcycle
  • helicopter
  • plane