Vehicle Art Setup

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

The basic art setup for a vehicle is its Skeletal Mesh. However, depending on the type of vehicle, you may need to give special consideration to the suspensions. For example, a tank does not need a suspension setup, as they are not visible. However, a dune buggy, such as the one in the sample Vehicle Game will need joints to make the exposed components simulate in a realistic way.

Basics

The vehicle mesh should face the positive X axis.

The vehicle mesh should face the positive X axis

In your modeling software measure the radius of your wheels, in centimeters, for use within Unreal Engine.

measure the radius of your wheels

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 3Ds Max.

Joints

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

The wheel and root joints should be aligned with X forward, Z up

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 not centered, it will look like the wheel is broken.

Binding

Use the standard smooth bind for Maya or the Skin Modifier for 3Ds Max. Wheels should only have weighting to one joint, so they can spin freely with no odd deformation. For shock absorbers and struts you can apply more detailed skinning.

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 should enable the importer's Create Physics Asset option.

Physics Asset

The vehicle Physics Asset is necessary for the proper simulation of vehicles in Unreal Engine. When first importing a Skeletal Mesh, Unreal Engine can create a Physics Asset automatically. In the Content Browser, Double click the dune buggy Physics Asset to open it.

Vehicle physics asset

You are now seeing the generated Physics Asset for the vehicle. Notice how Unreal tries to wrap the vertices skinned to each joint. However, you can improve the quality of the physical simulation by creating the bodies manually.

Physics asset created when the vehicle was imported

Go to the Skeleton Tree panel on the left and select all the physics bodies on the tree. Right click and select Delete.

Delete all the physics bodies

Physics Body Creation Set-up

On the Skeleton Tree panel, click the Settings icon to open the menu and select Show All Bones.

Select Show All Bones

You can now see all the bones from the Skeletal Mesh.

The bones are showing on the Skeleton Tree

Create the Body Collision

Now you can create the physics body for the dune buggy's body.

  1. Go to the Tools panel and under the Body Creation section, click the Primitive Type dropdown. Select Box.

    xxx

  2. Go to the Skeleton Tree panel and right click on the root joint, then select Add / Replace Bodies. This will add a physics body in the shape of a box to the buggy's body.

    Click Add / Replace Bodies

  3. You can then move, rotate, and scale the new Physics Body to better approximate the shape of the buggy's body.

    Scale the physics body to match the shape of the buggy's body

The Physics Body created will be the root of the hierarchy of Constraints and Physics Bodies created for the rest of the Skeletal Mesh.

Create the Wheel Collision

Follow the same process as before to create the Physics Bodies for the wheels:

  1. Go to the Tools panel and under the Body Creation section, click the Primitive Type dropdown. Select Sphere.

    Change the Body Creation Primitive Type to Sphere

  2. Go to the Skeleton Tree panel and select the wheel joints. Right-click and select Add Replace/Bodies.

    Select Add Replace/Bodies

    The wheel Physics Bodies are now created

  3. Select the newly created Physics Bodies for the wheels, then right-click and select Physics Type > Kinematic.

    Select Physics Type - Kinematic

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

    Select Physics Type - Kinematic

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

    The wheel Physics Bodies are not used for collision. The wheels use ray casting to interact with the environment.

Select all the joints and bodies inside the Skeleton panel and look at the Graph panel below. You will see the relationship between all the Physics Bodies and Physics Constraints in the vehicle.

The Graph panel shows the relationship between bodies and constraints

Taking it Further

This is a simple setup for an imported vehicle Mesh. If you examine the Physics Asset from the buggy in the Vehicle Game, it looks like this:

Physics Asset from the Vehicle Game

Notice how additional bodies are used along the sides of the vehicle to prevent the wheels from clipping through objects in the world. When importing your own vehicles, you may need to add addtional bodies to achieve the desired results during simulation.

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