What's the fastest way to store prefabs in an endless racing game?

I’m currently making an endless racing game, in which I use prefabs to generate new roads when the player car moves forward. I currently store the generatable prefabs in the prefabs themselves, and I don’t think it’s an efficient way to do it, and I’ve got a few ideas, how to change it:

  • Make a Game Object, which stores them
  • Access them from their folder, if there is a way to do it

The game also got different types of roads (like highway, city, B road), so I also got to check for it.

And if you’ve got better ideas, please share it!

Thank you! :slight_smile:

Create gameobject pools, idea is to maybe instantiate but almost never destroy anything. Instead set active to false unneeded gameobjects and reset active when needed.
You will need to create pool manager which will hold instances of all gameobjects and their types.