Vehicle Art Setup

How to setup the art assets for a vehicle in Unreal Engine 4.

Windows
MacOS
Linux

The basic, bare minimum, art setup for a vehicle is just a Skeletal Mesh. The type of vehicle will decide how complicated an art setup you will need, and special consideration may need to be given to the suspension. A tank does not need to have a crazy suspension setup, because it will almost always go unseen, but a dune buggy, such as the one in Vehicle Game, will require more joints to make all the exposed components move in a believable way.

Basics

The vehicle mesh should point down Positive X.

basics01.png

You will need to measure the radius of your wheels, in centimeters, for use within Unreal Engine 4.

wheelRadius.png

In the image above, the Distance Measurement tool in Maya is being used to get the diameter of the wheels based on the distance between 2 vertices opposite each other on the wheel. The radius of the wheel is half of this value.

A similar tool exists in the Helpers section of 3D Studio Max.

Joints

The absolute minimum number of joints required for 4 wheeled vehicle, is 5:1 root, and 4 wheels. The wheel and root joints should be aligned with X forward, Z up:

wheelJnt.png

This will ensure they roll on the Y axis and steer on the Z axis.

All other joints can be arranged as you see fit, but it should be noted that things like Look At nodes for the Animation Blueprint assume X forward.

To prevent visual oddities, the joints for the wheels should be accurately centered. The visual mesh will not be used for collision detection, however, if the wheel mesh is off center, then it will look like the wheel is broken, and will be really noticeable due to motion blur.

Binding

Standard smooth bind for Maya or Skin Modifier for 3DS Max. Wheels should only have weighting to one joint, so they can spin free with no odd deformation. For shocks and struts, you can get away with some fancy skinning, but it will require more thought on the Unreal Editor side.

Export

Vehicles are exported as Skeletal Meshes , with no special considerations.

Import

Vehicles are imported using the standard FBX import for a Skeletal Mesh. You will want to enable the importer's Create Physics Asset option.

Physics Asset

PAicon.png

The Physics Asset is incredibly important for vehicles, and cannot be overlooked or skipped. When you first have Unreal Engine 4 create a Physics Asset for you, it will probably end up looking much like this:

badPA.png

That is because the Physics Asset Tool (PhAT) attempts to wrap the vertices skinned to a joint the best it can. However, you are going to delete and re-create them all. Why? The PhAT does not currently have a way to gracefully handle the re-creation of the constraints that hold all the Physics Bodies together. So if you delete an intermediate Physics Body, it does not create a new constraint up the hierarchy. However, if you delete all the Physics Bodies and start building them from the Vehicle root joint out, all your constraints will get created correctly.

In the Skeleton Tree panel with the default display options (Physics Bodies only), select and delete everything. This will remove all Physics Bodies from the asset.

selectAllDelete.png

Physics Body Creation Set-up

  1. Open the Skeleton Tree panel Options dropdown menu, and select Show All Bones.

    ShowBones.png

  2. At each creation step, check that the Body Creation settings in the Tools panel are what you need; there are two settings in particular to pay attention to

    • Min Bone Size defines how large a bone must be for a Physics Body to be created for it, make sure it is set for an appropriate size for your Skeletal Mesh. In this example, we set it to 5.

    • Primitive Type controls the basic shape of the Physics Body created, you will need to change the type depending on the Physics Body being created.

    • For the purposes of this example, the other options can be left as is.

    BodyCreation.png

Create the Body Collision

Now, starting with your root joint, start creating physics bodies. Keeping in mind, you only need a physics body on a joint that either needs to be physically simulated or affects the bounds of the vehicle.

In the case of our buggy here, a box for the body and spheres for the wheels will be just fine to start, but it will require a number of other Physics Bodies to get the desired behavior.

  1. Change the Body Creation Primitive Type to Box.

  2. Right-click the rootJNT bone in the Skeleton Tree panel to open the context menu.

  3. Select Add/Replace Bodies.

    bodyToRoot.png

  4. You can then move, rotate, and scale the new Physics Body to better approximate the shape of your vehicle

    newBodyBoxResultScaled.png

The Physics Body created will be the root of the hierarchy of Constraints and Physics Bodies created for the rest of the mesh. You can see the relations directily in the Graphs panel, and alongside the bones in the Skeleton Tree panel.

Create the Wheel Collision

To create the spheres for the wheels:

  1. Change the Body Creation Primitive Type to Sphere.

    BodyCreationSphere.png

  2. Select the wheel joint bones in the Skeleton Tree panel, then right-click to open the context menu.

  3. Select Add Replace/Bodies.

    bodyToWheel.png

  4. Select the newly created Physics Bodies for the wheels, then right-click to open the context menu.

  5. Under Physics Type, select Kinematic.

    makeTheWheelsKin.png

    You can also change the Physics Type from the Details panel in the Physics section.

    makeTheWheelsKin_2.png

    This is necessary for the wheels to affect the bounds of the vehicle so shadows and culling occur correctly, and also, to prevent them from just rolling off the vehicle once your game begins.

    The wheel Physics Bodies are never actually used for collision. Currently, the wheels use a ray casting for interacting with the world.

Taking it Further

This is just a simple setup for a basic imported vehicle mesh. If you examine the Physics Asset for the Vehicle in Vehicle Game, it looks like this:

goodPA.png

Outside of the wheels, all of those collision bodies exist on the root joint of the vehicle. They prevent the wheels from getting jammed on certain game elements, and also prevents the meshes of the wheels from clipping through walls and railings.

Select Skin
Light
Dark
Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback