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:
![](https://static.packt-cdn.com/products/9781839217616/graphics/assets/8b1563ab-0315-4ad7-aa9b-0f2ec05c8e4a.png)
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.