Table of Contents

Quick Start

Vehicle Model Requirements

Ensure that your vehicle model has the appropriate Unity rotation and pivot points. The model should use the following axes: Z - Forward, Y - Up, and X - Right. If your model has incorrect rotation and/or pivot points, consult this guide.

An example of a vehicle model with Unity-correct rotation.
Example vehicle model hierarchy.

Maintain a vehicle scale of [1,1,1]. Adjust the vehicle scale using the model import settings in Unity or 3D software prior to vehicle setup.

Physics Settings

If making an open-world game with a large-scale map (> ~4000 units), the shifting origin is required (not only for this asset, but in general with game engines that use floating point precision). Explanation.

Automatic Setup

Vehicle Setup Wizard

To set up a vehicle automatically, use the VehicleSetupWizard. Ensure that your vehicle has correct pivots and rotation first. Then, attach the VehicleSetupWizard to the root object of the vehicle—where the Rigidbody would typically be placed. Follow the steps from the wizard inspector. The VehicleSetupWizard logs all actions, errors, and warnings in the console. Review and correct these manually if necessary. Depending on the settings, you might need to set up the input manually: Input Setup page

Manual Setup

Rigidbody

Add a Rigidbody component to the vehicle root, Car in the image above. Set the mass to a reasonable value, e.g., 1400.

Colliders

Add a Collider (BoxCollider, MeshCollider, etc.) to the vehicle. Rigidbody requires a collider to function properly.

Variable Center of Mass

Add the VariableCenterOfMass component to the vehicle root. This is not required but is recommended, as it allows for the adjustment of the Center of Mass and Inertia, both of which significantly impact handling. For Unity 2023 and newer, you can adjust the center of mass and inertia tensor directly on the Rigidbody, so this script will not be needed.

WheelController3D

For a vehicle to function properly, it requires wheels. NWH Vehicle Physics uses the included asset WheelController3D instead of the default WheelCollider. For more information, consult the WheelController Setup page. Since v10.0, WheelCollider can also be used.

Vehicle hierarchy with WheelControllers and positioning of front left WheelController on the example vehicle.
Wheel gizmo. The vertical 'I' represents the suspension travel while the cylinder represents the wheel.

Input

The guide above is recommended for understanding of how input works. Below are the 'quick' steps needed:

Cameras

VehicleController

Assembly Definitions

This asset uses Assembly Definition (.asmdef) files. There are many benefits to assembly definitions but a downside is that the whole project needs to use them or they should not be used at all.

Using LogitechSDK (which does not fature assembly definitions) will therefore require an addition of .asmdef file inside the LogitechSDK directory and a reference inside NWH.VehiclePhysics2.VehicleController or removal of all .asmdef files from the asset if you do not wish to use assembly definitions.

Video Tutorials

These videos have been created by Game Dev Project and are not official tutorials but they might help with the setup. Reading the documentation is still highly recommended.

Getting started with NWH Vehicle Physics 2 - Unity Asset Tutorial

Model to Driveable in Under 60 Seconds - NWH Vehicle Physics 2 for Unity