Answer the question
In order to leave comments, you need to log in
How to randomly generate doors on a certain plane?
Dear friends! Can you tell me how I can randomly generate doors on a certain plane. For example, I have 4 walls on 1-3 walls, it is necessary that the doors spawn randomly. I'm just confused or not quite understanding (
Answer the question
In order to leave comments, you need to log in
arrange the door respawn points, combine them into an array, randomly select points in the array, spawn the doors.
you can do it without anchors, it's not much more difficult.
-an array of doors in the location
-random. get number. for example, from 0 to 1.
-less than 0.5 - there is a door at the point, more - no. (or vice versa).
- put doors.
- when generating the next location BEHIND this wall after starting the random house, force the door to be placed. so that the locations are connected by a passage "door".
essno you need to save the created location configuration somewhere ... so that it will not be updated at the next location :) ..... although ....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question