instantiate random prefabs based on player camera distance

I made a few prefabs I’d like to use in my project, but I don’t really understand where this takes place, before starting the game itself (pressing Play on the menu) to trigger the instantiate, or during the game attach it to your player and check how much the player sees and if needed to generate more prefabs.

simply make an empty game object (placed in your scene) have it spawn/instantiate your random prefabs at the start of the scene. (do this in the Awake function of the empty object)

Alternatively (and a not really the best solution) have a large sphere collider attached to your player. Have this set to the same size/distance as your player can see. Place empty game objects at strategic points around your scene and when the player collider collides with these have them spawn more prefabs.