3D models and environment

Vehicles

A good vehicle 3D model mets these minimum standards:

Importing the FBX alone should comply with these rules without having to create a prefab first.

A high quality vehicle 3D model also mets these conditions:

Interior

Dashboard gauges and steering wheel must meet these requirements:

Typically, the center of rotation of the steering wheel is the center of the external circumference. Using the central part or logo as center is a common mistake.

Vehicle collider

Game-ready 3D vehicles usually come with a simplified shape of the vehicle (collision mesh). The vehicle collider must be a convex collider (MeshCollider > Convex), or a set of convex colliders.

At least one convex collider is mandatory in the vehicle

A vehicle without colliders will exhibit a very weird and unnatural behavior as soon as the simulation starts, unless the inertia tensor is explicitly configured (Rigidbody.inertiaTensor).

The collision mesh is used for collision detection and inertia calculations. The vehicle dynamics are actually affected by the shape of the collider. Thus, a collider resembling the shape of its vehicle will provide a better simulation.

Convex vehicle collider

The collider of the vehicle can be:

VPWheelCollider components must be located inside the vehicle's colliders

Ensure that the top half of each VPWheelCollider component is enclosed within regular convex colliders belonging to the vehicle's main rigidbody. Otherwise, strange behaviors and side effects may happen when the vehicle enters in contact with other objects.

Good (left) and bad (right) positions for the VPWheelCollider with respect to the vehicle collider

Articulated vehicles

Multi-body vehicles such as trucks with trailers can be attached together. Each part is a 3D model that can be setup as an independent vehicle with its own Vehicle Controller (i.e. trailers) or as a a separated rigidbody with all wheels configured in the main Vehicle Controller (i.e. articulated bus).

Add a VPVehicleJoint component at the transform representing the male plug:

Both bodies should be close enough to the connected position for preventing abrupt movements when the VPVehicleJoint gets enabled.

Each body must have its collider according to the collider specifications above.

Driver's view

Configuring the head movement in the first person view provides a nice feeling of the inertia in the driver's view. Add a VPHeadMotion component to a child gameobject of the vehicle:

Scenery

TO-DO:

Colliders, continuity, player safety.

Roads & tracks do & dont's

Physic Materials

TO-DO:

Unity physic materials for vehicles and environment.

Different grip levels on different surfaces.

Settings to represent asphalt, grass, concrete walls, tire walls, etc

Learned from Box2D: https://github.com/erincatto/Box2D/blob/master/Box2D/Box2D/Dynamics/Contacts/b2Contact.h