I’m working on an endless platform runner.
To generate platforms in runtime, my platformGeneration script has a GameObject list platformsList. It randomly chooses one element of the list to instantiate.
platformsList is a set of references to many prefabs, each of which consists of one or multiple pre-built platforms. I manually assign each reference from the inspector.
The problem is, as I have more and more different prefabs, having to assign each reference individually is quickly becoming impractical and very likely to lead to human errors.
So I ask: is there any way of getting, say, all the prefabs in a file directory, directly from the script? Or a way of referencing the entire directory from the inspector?
1 Like
That’s exactly what I needed. Thanks!