-
helo!
I am making a 3D game where i have a room with 4 doors (the room is a prefab made in the editor)
On each side.
I loop through the doors randomly taging some of them with a “Open” tag
Then i instantiate a randomly selected prefab (another room or a hallway ) next to the current room. -
Issue : instantiating next room using the door marked as open makes the room spawn on the door, and i am unable to get some sort of offset because every door have a diff position (remember the script loops through doors so they are not seperated into like 4 groups up down left right)
-
What i want to do : instantiate the next room prefab using the “selected” door’s position in a way that the room spawn for example n distance away from the door.
-
Note: all doors have their local Y axis pointing away from the center of the prefab room they are part of.
—Solved it by ramming head to the wall…jk, ended up spawning prefab as child moving it in local axis than removing it from parent.
outcome : expected behavior
opinion: wished if it could be done in a less tedious process, but got the job done.