Random Room Generator

Hello!

I would like to create a script that allows the map to be created randomly everytime you play it, but I have no idea how I can code it.

The script will use prefabs to create the rooms. You have to create the prefabs and put them in your assets. Then you can set the amount of rooms you can have. Like 2 dead end rooms, 5 hallways and 1 ending. The map will be created once the game is started. To make so the rooms connect, you have to set a emptry game object at each side where you want a new room to be created. The empty game object have to clip in the end of the side. This is head to explain but there us a picture lower down on the page. The thing I just said doesn’t really have to be done. Only in the worst cases. I think there would be a easier way to do this. The rooms will then randomly get created with the brefabs and it will try and avoid to clip trough another room.

That is how I want a script to work but I have no idea how to script it so if you would know, pleas etell me! :slight_smile:

alt text

For those who are interested in this, I would recommend you get DunGen from the assets store. It’s a little bit pricey but it works really well and it’s worth the money!