Avoiding obstacles

Next, we'll look at an obstacle avoidance mechanic. To get started, pop open the same scene, named ObstacleAvoidance. The sample scene is quite straightforward. Aside from the camera and directional light, there is a plane with a series of blocks that will act as our obstacles, a cube that will act as our agent, and a canvas containing some instructional text. The scene will look like the following screenshot:

The sample scene setup

The hierarchy for the preceding scene pictures looks like this:

The organized hierarchy

Get Unity 2017 Game AI Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.