Question about doors in unity

I’m attempting to develop a horror game similar to PT and have a few questions about if unity would be able to do what I’m aiming to do.

There is a section I have planned out where the player would enter through a door and it would take them back to the room they started in, but if they opened the door back up behind them it would just be a closet.

I’m assuming it would be possible if I were to load into a new scene when entering the door - but is it possible to do something like this while staying in same scene?

Thanks!

I’m pretty new to coding and Unity, but I think I have an idea. Make your room and all of its objects in 1 empty game object, and then your closet the same. Then when you go through the door, you can disable the whole room by using gameObject.SetActive (false), then set the closet to Setactive true. This would probably work, so I hope this helps.

Create the Closet you want to be showing up, when you enter the door from the other side. All closet objects should refer to one parent object that you then activate/inactivate with the GameObject.SetActive(bool enable) function.

When your player coordinates are on the A side and open the door, you should inactivate the closet, and when your player coordinates are on the B side and open the door, you should activate it.