Many games make use of spawn points and waypoints. This recipe will show you how to choose a random spawn point, and then the instantiation of an object at that chosen point:
Figure 9.9 – Sphere randomly spawned at one of the spawn point capsules
As shown in the preceding figure, the sphere has been spawned at one of the four capsule spawn points.