Language:
Page Info
Tags:
Skill Level:
Engine Version:
Share
此中文页面内容对应的英文页面有后续更新,如需浏览最新文档可切换至英文页面浏览。

2 - Creating a Vehicle Animation Blueprint

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

Animation Blueprints

The Animation Blueprint will be used to specifically 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 easily drive these types of animations.

Wheel Handler Node

Where the Animation Blueprint is used to get and control our animations for the vehicle, more specifically, the Wheel Handler node makes controlling all these animations for the vehicle fairly easy with little to no additional setup! It just 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 that to animation on the bone 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 and then select Animation Blueprint from the menu list.

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

    Alternatively, you can create an Animation Blueprint directly from your Skeletal Mesh by selecting it in the Content Browser and from the context menu 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 and in the Anim Graph you'll want to start by bringing up the context menu and then search for the Mesh Space Ref Pose node and select it from the list to create it.

    meshSpace.png

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

    wheelHandler01.png

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

animBPanimGraph.png

  1. Optional If you have additional struts or other suspension needs, like the Buggy from Vehicle Game, you will need to 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 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

That's it for 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 your Vehicle Blueprint that brings all the previous steps together!

Tags