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 hierarchy for the preceding scene pictures looks like this: