Unity Artificial Intelligence Programming
上QQ阅读APP看书,第一时间看更新

Setting up waypoints

Next, we will put four Cube game objects at random places. They represent waypoints inside our scene and, therefore, we name them WandarPoints:

WandarPoints

Here is what our WandarPoint object will look like:

WanderPoint properties

Note that we need to tag those points with a tag called WandarPoint. Later, we use this tag when we try to find the waypoints from our tank AI. As you can see in its properties, a waypoint is just a Cube game object with the Mesh Renderer checkbox disabled, and the Box Collider object removed.

We can select the gizmo icon by clicking the small arrow near the object's name in the inspector 

We could even use an empty object with a gizmo icon since all we need from a waypoint is its position and the transformation data. However, we're using the Cube objects here so that waypoints are easier to visualize.