November 2018
Beginner
246 pages
5h 23m
English
In this section, we will explore obstacle avoidance. As a first step, we need, of course, obstacles. We will set up a scene similar to the one shown in the following screenshot. Then, we will create a script for our character so that it can avoid the obstacles while trying to reach the target point. The algorithm presented here uses the raycasting method, which is very straightforward, but on the other hand, it can only avoid the obstacles that are blocking the path directly in front of it:

To create this, we make a few cube entities and group them under an empty game object called Obstacles. We will ...
Read now
Unlock full access