Vehicle Rigging for Unreal

Model specs

First of, all credits go to EA and whomever converted the model. You can download the model for free from http://gfx-3d-model.blogspot.com

The Evo model came in many separate parts, I guess because EA uses different parts for when the car is damanged and switches between them once the damaged condition is met, I am not going to make use of that so what I did is combining the different parts into one mesh.

The model has to point down positive X. [1] Its definately a time saver if Maya is adjusted according to Unreal specs. In Maya preferences under Settings, World Coordinate system has to be Z and not Y. This can help with joint orientation later on and generaly make life easier when working with Unreal and Maya.


Fancy rig add-ons

As far as it goes a vehicle rig that works in Unreal can be a root joint + 4 joints for the wheels and the basic skin applied. I decided to add some customizations to the car's rig just because I like experimenting and I really wanted to see where things could go. Here is what I did:

Joint orientations

The wheel and root joints should be aligned with X forward, Z up. The orientation of other joints in the rig is not important for the game engine but it should be noted that Look At node and animation blueprints assume X forward. [1]

The joints for the wheels should be precisely centered. This is because the wheels meshes are not goint to be used for collision detection. The collision is added later on in Unreal and its based on the position of the joints thus if the joints are not centered the wheels will rotate awkwardly.

 

Wheels

This model is detailed enough to have the breaks' models and textures. The breaks rotate along (assuming the jnt orientation is as mentioned above) Z and Y axis of the wheels. For the purpouse, two joints can be place at the same position and parented under the root. In the connection editor the XZ rotation of the wheel joint is connected to the XZ rotation of the breaks joint.

 

Simulating wheel rotation when the body control is being moved forward or backwards

This one is pretty useless in regrads of Unreal but it's something I found to be interesting and neat in Maya. The way to be acheived is by going to the expression editor and creating new expression with the following code:

<yourFrontLeftWheelJointName>.rotateY = <yourRootControlName>.translateX;

<yourRearLeftWheelJointName>.rotateY = <yourRootControlName>.translateX;

<yourFrontRightWheelJointName>.rotateY = <yourRootControlName>.translateX;

<yourRearRightWheelJointName>.rotateY = <yourRootControlName>.translateX;

 

It should be noted that if one or more attribute is already driven by something this wont work and it will return error: 'Attribute already controlled by an expression, keyframe, or other connection'[2].

 

Suspension

The suspension or rather the way it looks like suspension is creating by placing a joint at the center bottom of the vehicle. The whole body is going to be weight painted to that joint. The control is orient constrained to the joint and it has its pivot at the center of the joint.

 

Steering wheel and window wipers

The joint resposible for the steering wheel roations has to be placed in the center of the steering wheel model. The orientation of the joint has to along the steering wheel tilt.

Windshield wiper joints should be oriented so that they rotate along the windshield. This one is tricky because it needs a lot of adjustments. Once positioned, rotate the joint the way wipers do and you could end up with the wiper hovering above the windshield. It just needs a lot of adjustments or luck to nail the orientation properly but its definately doable. :thumbs up:

Under the steering wheel control, I created a new attribute called 'Wipers' and in the connection editor I linked the said attribute with the Z rotation of each window wiper. This way window wipers move together and dont need to be rotated separately.

Wheel joint orientation
Wheel joint orientation
Wheel rotation and breaks following along XZ
Wheel rotation and breaks following along XZ
Wheel rotation after body control is moved ±X
Wheel rotation after body control is moved ±X
Car body joint placement in the center bottom of the vehicle
Car body joint placement in the center bottom of the vehicle
Steering wheel and window wipers joint orientation
Steering wheel and window wipers joint orientation

Result

Resources

Write a comment

Comments: 0