Creating the Vehicle Blueprints

To create a new Vehicle Blueprint, let's first navigate to our VehicleContent folder in Content Browser and then right-click on an area that is empty. From the context drop-menu, we will select the Blueprint Class option, click on the drop-down All Classes menu, search for the WheeledVehicle Pawn class, and name this blueprint BP_NewVehicle.

Creating the Vehicle Blueprints

The WheeledVehicle Pawn blueprint contains an inherited component called VehicleMovement. This component allows you to have more control over the wheels and the overall behavior for the vehicle.

Next, we will need to create two different types of Wheel Blueprints for our vehicle (one for the front wheels and one for the back wheels). To get this going, let's navigate to the VehicleContent folder in Content Browser, right-click on an area of Content Browser that is empty, and select the Blueprint Class option. Now, in the context sensitive drop-down menu, enter Vehicle Wheel to locate the VehicleWheel Blueprint Object class. We will create two different VehicleWheel Blueprint classes (one named BP_FrontWheel and another named BP_BackWheel).

In most cases, we will want to have at least two wheel types: that is, one wheel type that is affected by steering and another that is affected by the vehicle handbrake. Additionally, we can set differing radii, mass, width, handbrake effect, suspension, and many other properties to give our vehicle the handling we desire.

Now, we can move on and create the TireType data asset that we will need for our VehicleWheel blueprint. To create a new TireType data asset in Content Browser, we need to right-click on an area of the VehicleContent folder that is empty, select the Miscellaneous option and then the TireType option from the context sensitive drop-down menu that appears:

Creating the Vehicle Blueprints

Let's name this asset DA_TireType and then right-click on the asset to open Generic Asset Editor. The TireType data asset has only one single value: Friction Scale. This value not only affects the raw friction of the wheel, but also scales the value for how difficult or easy it is for a wheel to slide during a hard turn. There is a property slot in the VehicleWheel blueprint for the TireType data asset that we will use once the time comes.

Lastly, we have to create the Animation blueprint. We will use this to animate our Buggy Vehicle. To do this, navigate to Content Browser and then go to the VehicleContent folder. Now, in an empty area, right-click and select the Animation option from the drop-down menu and then select Animation Blueprint:

Creating the Vehicle Blueprints

When we first create an Animation Blueprint, it will ask us for a Target Skeleton to use; we will select the SK_Buggy_Vehicle_Skeleton option from the Target Skeleton drop-down list. We also want to make sure that we select the VehicleAnimInstance option from the Parent Class context sensitive drop-down list and name this animation blueprint BP_VehicleAnimation. Before we move on and discuss how to edit the different blueprints and data assets we created to complete our vehicle, let's briefly discuss what animation blueprints are.

An Animation Blueprint is a specialized blueprint that contains graphs used to control the animation of a skeletal mesh. It can perform blending of animations, has direct control of the bones in a skeleton, and outputs a final pose for our skeletal mesh in each frame. The Controller directs the pawn or character to move based on the player input or decisions made based on what the game play dictates. Each pawn has a Skeletal Mesh component that references the Skeletal Mesh to animate and has an instance of an Animation Blueprint.

Through the use of its two graphs, the Animation Blueprint can access properties of the owning pawn, compute the values used for blending, state transitions, or driving Anim Montages, and can calculate the current pose of the skeletal mesh based on the blending of animation sequences and direct transformations of the skeleton from Skeletal Controls. When we work with animation blueprints, we have to keep in mind that there are two main components that work in correlation with one another to create the final animation for each frame. One is Event Graph that we can recognize from other blueprints. This is in charge of performing updates to values that can be used in Anim Graph to drive State Machines, Blend Spaces, or other nodes that allows you to blend between multiple animation sequences or poses that fire off notifications to other systems, thereby enabling dynamically-driven animation effects to take place.

There is one Event Graph in every Animation Blueprint that uses a collection of special animation-based events to initiate sequences of actions. The most common use of Event Graph is to update the values used by Blend Spaces and other blend nodes to drive animations in the Anim Graph.

The Anim Graph is used to evaluate the final pose of a skeletal mesh for the current frame. By default, each Animation Blueprint has an Anim Graph. This graph can contain animation nodes that are placed in it to sample animation sequences, perform animation blends, or control bone transformations using Skeletal Controls. The resulting pose is then applied to our Skeletal Mesh for each frame in the game.

Creating the Vehicle Blueprints
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.243.100