- Home /
Is there a way to load premade terrain chunks randomly?
Hi! I'm making a game where the player is in a car and has to shoot down animals that are running across the road. Pretty simple game as I'm new to all this. I was wondering if there is a way to create sort of like "chunks" of terrain, like roads, background stuff like trees and rocks etc. And then making unity load them in randomly?
The idea is that the world is gonna spawn in infront of you and then gets deleted when you can't see it anymore behind you. I'd really appreciate any help. Is there a word for what I'm looking for? Do you know of any videos showcasing this? Any help would seriously be appreciated!
Thanks :)
Answer by CardboardComputers · Apr 12, 2021 at 10:38 AM
It seems like a pretty simple form of procedural generation. A lot of tutorials I've seen involve procedurally generating levels or dungeons, but for this game you wouldn't need even that level of complexity. You could just save those chunks of terrain as prefabs and then instantiate them as the player approaches; once the player passes far enough you could then destroy it. The same also goes for the animals.
This is exactly what I was thinking of, thank you for taking time and helping out a newbie haha :)!