Language:
Page Info
Tags:
Skill Level:
Engine Version:

Simple Wheeled Vehicle Movement Component

Choose your OS:
Prerequisite Topics

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

The SimpleWheeledVehicleMovement component provides wheel suspension and tire friction without the complexities of engine or drivetrain simulation. Instead, it lets you easily apply torque to individual tires for components inheriting from Wheeled Vehicle Movement component, which can give you vehicle-like movement to arbitrary components without having to rely on the Wheeled Vehicle Actor class.

In order to setup and use SimpleWheeledVehicleMovement component, you will first need to complete the following steps outlined in the Vehicle User Guide . Use these steps to make sure your vehicle is setup properly before proceeding:

Creating a Simple Wheeled Vehicle Blueprints

To create a new Simple Wheeled Vehicle Blueprint, in the Content Browser click the Add New button, navigate to and click on Blueprint Class, and finally, select Pawn from the options in the Pick Parent Class window.

SimpleWheel_CreatePawnBP.png

Editing the Simple Wheeled Vehicle Blueprint

Now that we've created a Simple Wheeled Vehicle Blueprint, we can start to set up our simple vehicle movement. So, if your vehicle mesh is ready and you have already setup your wheels, then you will be able to apply vehicle-like properties to arbitrary objects that do not require the drive-train or simulation of a normal vehicle.

Double-click your SimpleWheeledVehicle Blueprint from your Content Browser to bring up the Blueprint Editor.

  1. In the Components window, use the Add Component button and add a Skeletal Mesh component.

    SimpleVehicle_AddSkelComp.png

    Then click and drag the Skeletal Mesh component onto the DefaultSceneRoot component. This will make it the root for this Blueprint.

    SimpleVehicle_SkelSceneRoot.png

  2. With your Skeletal Mesh component selected, set the Anim Class to your vehicle's Animation Blueprint and then assign your Skeletal Mesh.

    SimpleVehicle_AssignAnimBP.png

  3. Return to the Components window and add SimpleWheeledVehicleMovement component.

    SimpleVehicle_AddSWComp.png

  4. With the SimpleWheeledVehicleMovement component selected, in the Vehicle Setup section click the down arrow to expand Wheel Setups and then click the + to add your wheels.

  5. For each wheel (0-3):

    • Set the Wheel Class to one of the wheel Blueprints you created.

    • Set the Bone Name to the name of the joint that should be controlled by the wheel.

    wheelsSetup.png

    The Bone Name in the above image is specific to this Skeletal Mesh.

    The order you assigned the wheels has no bearing on if it is a front or rear wheel, only the Bone Name and Wheel Class have any effect.

    If you need more than 4 wheels, you can click the "+" icon next to the Wheel Setups property to add more.

At this point, assuming your vehicle is not substantially larger than a minivan, the default values will be a good starting point to start testing.

Applying Torque to Wheels

In order for your simple vehicle to move, you'll need to apply torque to the individual tires that you want to move. You can do this by pulling off your SimpleWheeledVehicleMovement component and using Set Drive Torque. Use the Drive Torque value to set how much torque and the Wheel Index to assign a wheel that will have the torque applied to. The Wheel Index corresponds to the index number in the Wheel Setups section of the SimpleWheeledVehicleMovement's Details Panel.

SimpleVehicle_SetDriveTorque.png

Tags