How to Convert PhysX Vehicles to Chaos

This guide explains how to convert an existing PhysX vehicle to use the Chaos Physics solver.

Windows
MacOS
Linux
Prerequisite Topics

This page assumes you have prior knowledge of the following topics. Please read them before proceeding.

As mentioned in the Chaos Vehicle Setup guide, the assets that make up a vehicle are a skeletal mesh, a physics asset, an Animation and Vehicle Blueprint, and one or more Wheel Blueprints. The process of configuring these assets for your vehicle will largely depend on whether you decide to use the PhysX or Chaos solvers.

Setup

Asset Configuration

At this time, the workflow involved with configuring assets remains the same — setting up physics collision, the camera, and vehicle controls should not change between PhysX and Chaos vehicles.

Animation Blueprint

The Animation Blueprint is the same with the exception of using the WheelController node in place of the WheelHandler node.

Class Layout

In most cases the class layout is similar, it is just the class names that are different.

PhysX Component

Chaos Component

VehicleWheel

ChaosVehicleWheel

VehicleMovement

ChaosWheeledVehicleComponent

VehicleAnimInstance

VehicleAnimationInstance

WheelHandler

WheelController

WheeledVehicle

WheeledVehiclePawn

Conversion Steps

  1. Create Front and rear wheel Blueprint classes — based on the ChaosVehicleWheel class.

  2. Copy the setup details from the PhysX vehicle wheels — the important details to copy are the wheel radius, the suspension max raise/drop values, steering angle, and whether the wheels have an engine, brake, or handbrake.

    We recommend converting the front wheel first, setting its values, then creating a duplicate and renaming it the back wheel. By doing this, you will only need to set the values that are different from the front rather than repeating all of the wheel setups again — since in most cases, the wheels and suspension setup will be the same from the front to the rear.

  3. Add a ChaosWheeledVehicleComponent Component to the vehicle pawn.

  4. Add the same number of wheels as in the PhysX Vehicle Component.

    1. Copy the Bone Names from PhysX Skeletal Mesh.

    2. Set the wheels' classes to the matching wheels that were created earlier.

    howtoconvertphyxvehicles1.png

    Example Wheel Class assignments

  5. Set up other properties as needed, including mass and engine torque.

    1. Optionally create a Torque Curve and assign it to the engine torque.

  6. Open the Animation Blueprint, select File > Reparent Blueprint, and click VehicleAnimationInstance.

    VehicleAnimInstance

  7. Edit the Vehicle Animation Blueprint by deleting the WheelHandler animation node and replacing it with the WheelController node.

    howtoconvertphyxvehicles2.png

    The Animation Graph after replacing WheelHandler with WheelController.

    All other setup that exists in the Blueprint can remain exactly as is.

  8. Verify the physics asset looks as expected. For example, the chassis should have a collision model and the wheels may have simple collision; however, the wheels should have collision disabled.

  9. In any Blueprint code that references the PhysX WheeledVehicleMovementComponent4W reference, remove the PhysX movement component references and recreate the Blueprint using the ChaosWheeledVehicleMovement reference.

    SteeringInput.png WheeledVehicleMovementComponent4W

After following these conversion steps, you should have a vehicle that uses the Chaos physics solver.

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