Many games make use of spawn points and waypoints. This recipe demonstrates two very common examples of spawning—the choosing of either a random spawn point, or the nearest one to an object of interest (such as the Player's character), and then the instantiation of an object at that chosen point.
This recipe builds upon the previous recipe. So, make a copy of this project, open it, and then follow the next steps.
To find a random spawn point, follow these steps:
Prefab-ball, and drag your Sphere into it (and then delete the Sphere from the Hierarchy ...