Vehicles - jgoffeney/Cesium4Unreal GitHub Wiki

Back

A collection of information on using vehicles in Unreal.

Topics

How to Set up Vehicles

Reference

Enable the Chaos Vehicles Plugins

The plugin ChaosVehiclesPlugin is a beta plugin as part of the Unreal physics system and currently in beta.

Creating and Editing Chaos Wheel Blueprints

The wheel blueprint is essentially an axel with one or more wheels and is responsible for the properties of the vehicle wheel, suspension and brakes. Typically a vehicle will have two wheels with one affected by steering, engine and brakes and the other passive. If the axels share the same properties then the same blueprint can be used for multiple wheels.

Create a Wheel Blueprint

  • Create a new Blueprint with ChaosVehicleWheel as the parent class.
  • Repeat for as many axels requires for the vehicle.

Edit the Wheel Blueprint

The following properties determine how the wheel performs.

  • Axel Type: defines if the wheel is front or rear.
  • Wheel Radius: the radius of the wheel matching the same scale as the vehicles in centimeters
  • Affected by Handbrake: enable for rear wheels
  • Affected by Engine: enable for wheels that drive the vehicle to set as front, rear or all wheel drive.
  • Affected by Steering: enable for front wheels. If more than one set of wheels is affected then set a different value for Max Steer Angle.
  • Max Steer Angle: usually set to a positive value in degrees. If you have all wheel drive then the rear wheels should have a negative value (so they turn in the opposite direction).

Creating a Curve Asset for the Engine Torque

The torque curve graph is setup as RPM vs. torque in newton meters. It is typically set up to increase the torque until around the center of the RPM range and then decrease to the max RPM.

  • Create a Curve Float asset.
  • Double-click to edit the curve and adjust the curve.

Importing a Vehicle Mesh

The Unreal tutorial uses the Buggy vehicle mesh from the Vehicle Game sample project. The Vehicle game template also has a buggy available if you import the content into your project.

Vehicle Physics Editor

  • Double click on the vehicle's Skeletal Mesh to open the editor.
  • Click on the Physics tab to open the Physics Asset Editor.

Creating and Editing a Physics Asset

Creating the Physics Asset

If the Skeletal Mesh does not have a Physics Asset then:

  • Right click the skeletal mesh and select Create->Physics Asset->Create and Assign.
  • Set Primitive Type to Single Convex Hull to create collision primitives for the bones.
  • Edit the Physics Asset and adjust the collision primitives for each bone to suit the mesh as below.
Editing the Physics Asset

The wheel bones need to have spherical colliders rather than autogenerated polytopes.