Book Image

Unity AI Programming Essentials

By : Curtis Bennett
Book Image

Unity AI Programming Essentials

By: Curtis Bennett

Overview of this book

Table of Contents (19 chapters)

Setting up a Smart Car vehicle


As Smart Car uses a realistic car setup, there are many options to configure your vehicle. To create a Smart Car vehicle, you'll need a car model with different models for wheels and Unity wheel colliders setup on them. After adding a car model to your scene, import the Smart Car 2.3 package and attach the SmartAICar2_3.cs script from SmartAICar2.3/Scripts. In the following screenshot, you can see some of the Smart Car AI fields from the script:

There are fields here you can customize such as Engine properties, including Engine Torque Curve, and the distances for the ray casts used for sensing. Most of these can be left to default values, but to run the script, you'll need to fill in the wheel properties, dragging from your model the colliders for the four wheels to the Wheel_FL, Wheel_FR, Wheel_RL, and Wheel_RR properties. You also need transforms for the wheel set. Also, there needs to be a transform for center of mass (COM), a lower point in the middle of...