- Home /
2D Openworld transport game. How to generate the tracks?
So I'm currently working on a openworld transport game. In some way at least. As in every other transport game you can pick a start location to get your loading and then pick the end location to deliver your ... things. Because I plan to have crossings between the end locations I can't use one track and spawn the vehicle at different positions. So I'm currently trying to code a LevelGenerator. I want to pass the 2 values (start, end ) to the LG and then connect different prefabs to generate the track. I figgured this out but is it a efficient solution? With 15 locations I have 15*15 else if cases and I have to disable and enable various Gameobjects in the beginning of a level. Example: I want to go from 1 to 3. So I connect my prefabs and enable the start and end builing in location 1 and 3 but disable the building on prefab 2 (with all necessary features like the end collider on 2 to prevent falling of the map or the trigger to count the transported goods). So I'm thinking about a different way to do that. Do you have an idea?
Thanks for helping me :)
Your answer
Follow this Question
Related Questions
What's an effective method for activating and deactivating gameobjects not visible to the camera? 3 Answers
2D Sprite Fillup without using UI 1 Answer
Climbing above and below a platform? 1 Answer
Can I make a 2D platformer without assets,Can I make a game without assets 3 Answers
Unity crashes 0 Answers