3 - Creating a Vehicle Animation Blueprint

In this step, we will create the Animation Blueprint that controls our vehicles animations.

Windows
MacOS
Linux

At this point, you've created the TireConfig Data Asset and your Wheel Blueprint(s), which you'll use later with the Vehicle Blueprint. In this step, you'll continue to ready your content by creating an Animation Blueprint that drives all of your animation needs for the wheels on the vehicle.

Animation Blueprints

The Animation Blueprint will be used to control the animation of our Vehicle Skeletal Mesh so that it has animations specific to a vehicle, like spinning tires, suspension, handbrakes, and steering. To offload a lot of the work in creating animations for these types of things, you can use the Wheel Handler node to drive these types of animations.

Wheel Handler Node

Where the Animation Blueprint is used to get and control animations for the vehicle, more specifically, the Wheel Handler node makes controlling all of the animations for the vehicle fairly easy with little to no additional setup. It simply grabs the necessary information from the wheels (How fast is it spinning? Is it affected by the Handbrake? What are the suspension settings for this wheel?) and translates the query results to an animation on the bone that the wheel is associated with.

wheelHandler02.png

Creating the Animation Blueprint

  1. In the Content Browser, click the Add New button, then hover over Animation, selecting Animation Blueprint from the menu list.

  2. In the Create Animation Blueprint window, locate and select your Skeleton from your vehicle's list. Then click OK.

    Alternatively, you can create an Animation Blueprint directly from your Skeletal Mesh by selecting it in the Content Browser, where you'll be able to select Create > Anim Blueprint.

    newAnimBP.png

  3. Now that you've got an Animation Blueprint to work from, you can open it from the Content Browser by selecting and double-clicking it. From the main toolbar select Class Settings and then in the Details panel set the Parent Class to VehicleAnimInstance.

    AnimBPParentClass.png

    If this is not properly set to the right Parent Class, you will not have access to nodes needed later in this guide.

  4. In the Anim Graph, you'll want to start by right-clicking to bring up the context menu and then searching for the Mesh Space Ref Pose node. Select it from the list to create it in place.

    meshSpace.png

  5. Next, right-click in the Anim Graph to bring up the context menu and then search for the Wheel Handler, selecting it from the list to create it.

    wheelHandler01.png

  6. Now, connect the nodes so that your Anim Graph looks like this one.

    animBPanimGraph.png

  7. Optionally, if you have additional struts or other suspension needs (like the Buggy from Vehicle Game) you will need additional nodes in your Animation Graph to handle the joints that affect those polygons. In the Buggy, from Vehicle Game, the extra joints are used to control the axle connections to the wheels. These are driven by a simple Look At node, which, when given the wheel joints, will be driven by the Wheel Handler node and the Look At nodes will make sure the suspension stays attached to the wheels.

    fullVehGameAnimBP.png

End Result

You've finished setting up the Animation Blueprint! The Component to Local conversion node will be created automatically and the Animation Blueprint will now drive the wheels of the vehicle. Continue on to the next step to learn how to create a Vehicle Blueprint that brings all of the previous steps together.

Tags
Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback