Game Development Reference
FIG 5.9 Adding waypoints
to the patrol script.
direction of the path. If you have all the waypoints collected correctly,
there should be a circuit around the building.
Step 7. To get the robot guard to patrol around the building,
modify the patrol code as shown in Listing 5.6 .
Listing 5.6 Ordering Guard to Traverse Waypoints
var waypoints: GameObject;
function OnGUI ()
GUI.Box (Rect (10,10,100,90), "Guard's Orders");
if (GUI.Button (Rect (20,40,80,20), "Patrol"))