Does anyone know how to implement Spawning system just like Dani’s game “Balls?”, i’ve tried everything thing that came in my mind but nothing work as it should. Any help from some genius peoples will be appreciated. THANKYOU!
(Waiting to see some genius ideas :))
I watched his devlog thingy like a while ago and I forgot what it looked like, but after a quick google images search, I think I have an idea of how it actually works.
So apart from the actual player movement, the spawning of prefabs occur when the player enters an area where he hasn’t entered, like how chunks work in minecraft, and then spawns a random collection of ‘balls’ in the player’s radius.
I’m guessing the map is split up like a grid, and ‘chunks’ are created when the player has entered an area outside the chunk’s radius that they are in. Then, the position of the balls might be generated using Random.insideUnitSphere
multiple times (which generates a random point inside of a sphere with a radius of 1) as well as a small check to make sure that the balls don’t spawn inside of each other, or too close. This occurs every time a new chunk is loaded, im guessing. @hamdanb234