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)

Additional features


We've just completed creating a driving demo with a car avoiding obstacles, but there are a few more things you can do with driving AI. We can add brake and drift zones to help configure the general behavior of the car as it drives around the scene, and we can integrate Smart Car with other AI systems such as RAIN.

Adding brake zones and drift zones

Another interesting thing you can do with Smart Car is define zones in the level to either cause the car to brake and slow down or adjust the friction of the car to make it drift. These are similar to the vector fields we saw in Chapter 5, Crowd Control, where we place them in the level to affect the AI, and they aren't visible to the player but are good to use for scripting level experiences. To create a brake or drift zone in your game, add a cube to the game (go to GameObject | Create Other | Cube) and scale and translate the area you want to tag in the level. In the Inspector window for the cube, set its tag to BrakeZone...