Summary

In this chapter, we created our own working vehicle with the Vehicle Game Project Example template step by step from scratch. In the process of doing so, we accomplished certain tasks.

First, we downloaded and created a project using the Vehicle Game Project Example template so that we could have access to several resources and content available to create a basic vehicle and a template racing game. Then, we created our own Physics Asset using PhAT with the default buggy skeletal mesh as a base and implemented our own Physics Bodies to the vehicle.

Next, we created all the necessary blueprints and data assets required in constructing a working vehicle for our game. To begin with, we created a Wheel Vehicle Blueprint component that contained the VehicleMovement (Inherited) Component class. Then, we created two different types of Wheel Blueprints (one for the front wheels and another for the back wheels). Each has its own set of unique parameters. Lastly, we created the Vehicle Animation Blueprint component required to obtain the proper motion of our wheels when we drive.

Additionally, we then edited each of these blueprints so that we could obtain the proper behavior for our vehicle. We also set up the user controls for our vehicle by editing Input Action and Axis Mappings so that the appropriate key bindings were set for our vehicle to move forward/backward in order to use the handbrake and steer left/right.

Then, we implemented the Blueprint logic within our BP_NewVehicle Wheeled Vehicle Blueprint by implementing the Input Action and Axis Mapping event nodes to the appropriate Vehicle Movement actions such as setting the throttle value, and the steering input values.

Lastly, we set up our own Game Mode Blueprint that utilizes our BP_NewVehicle Pawn Blueprint class and implemented that Game Mode into the Project Settings, as well as to the World Settings of our level. From there, we were able to play in-game and drive our vehicle around the level, and we posed the challenge of changing the parameters of our BP_NewVehicle in order to obtain unique behaviors for our vehicle.

In the next chapter, we will be covering advanced physics topics and troubleshooting concepts like pragmatic physics.

..................Content has been hidden....................

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