【Unity】Creating a maze-like space with many rooms (Basics)

In this article, I will introduce how to create a maze-like scene with many rooms using Unity. By learning how to create ceilings, walls, and corridors, you will become able to create VR spaces with rooms.


You can experience the sample scene in STYLY GALLERY.

You can download the Unity project that I used in this article from here.

Plan and design on paper

Since you will be using the position coordinates very often, it will be useful to write them down. It will help even if as simple as this.

The values in () are the Positions for each object.


Blueprint on paper

Creating the floor, walls, and ceiling

If you rotate the STYLY floor or Unity Plane for 90° and create walls, the wall will be slightly transparent in a VR scene.

To prevent this, we will create a wall by enlarging a cube in Unity.

Create floor

It is useful to gather all objects you need to create a room, so perform a Create Empty, and name it ‘room’.

Set the Position to (0, 0, 0).

Create Emptyでroomを作る

Create Empty and name it ‘room’

Next, create the floor.

Click Create>3D Object>Plane.

Set the Scale to (1,1,1). Name it ‘floor’.


Create floor

Create walls

Next, create the walls. Click Create>3D Object>Cube.


Create walls

Name it ‘left’, and set the Scale to (1,10,10). The walls are done now. Next, we need to move the walls.

Set the Position to (5,5,0).


Inspector values of left

Duplicate left, and name it ‘right’, then set the Position to (-5,5,0).


Duplicate left

The left wall and right wall is done.


Walls complete image

Then, let’s create the front and back wall. The steps are basically the same.

Click Create>3D Object>Cube. Name it ‘front’.

Set the Position to (0, 5, 5), Scale to (11, 10, 1).


Inspector values of front

Next, duplicate front, and name it ‘back’. Set the Position to (0, 5, -5). We are done creating 4 walls now.


Walls complete image

Create Ceiling

Lastly, let’s create the ceiling. Click Create>3D Object>Cube. Name it ‘ceiling’. Create it so it fits inside the room.


Create a cube inside the room

Set the Position to (0, 10, 0).

Set the Scale to (11,1,11).

The ceiling is complete now, and a box shaped room is created.


Complete room

Check if the floor, right, left, front, back, and ceiling fits properly in the room as in the image below.


room configuration

Create corridor walls

Next, let’s create the corridor walls.

The corridor walls need holes for pathways.

Create a wall with holes like in this image, combining 3 cubes


Complete image of the corridor walls

Use Create Empty to create a group. Name it ‘exit’. Check that the exit’s Position is (0, 0, 0).

We will connect it to where the front wall is, so delete front first.


Delete front

Create 3 cubes by Create>3D Object>Cube, and name them ‘exit-right’, ‘exit-left’, and ‘exit-top’. Place them all in the Exit.

Set the exit-right Position to (5, 5, -3), and Scale to (1, 10, 4).

Set the exit-left Position to (5, 5, -3), and Scale to (1, 10, 4).

Set the exit-top Position to (5, 7, 0), and Scale to (1, 6, 10).

The corridor walls are done now.

Check that the exit is now like in the image.


exit configuration

Duplicate the created room, and create the second one

Duplicate the room you just created. Set the Position to (20,0,0). Name it ‘room2’.

Set the Rotation to (0, 180, 0) and rotate the room for 180°, so that the holes will beside each other.


Complete image of 2 rooms

2 rooms are complete now.

Create corridor

2 rooms are done now, so let’s create the corridor between them.

Create Empty and name it ‘road’.

Set the Position to (0, 0, 0).

Create a Plane by Create>3D Object>Plane in the road you just created. Name it ‘road-floor’

Coordinates of objects created in Unity will be set as the object center. So, set the Position of road-floor (10, 0, 0), the center position between the 2 rooms.

We want it to cover the hole precisely, so set the Scale to (1,1,0.2).

The corridor floor is done now.


Creating the corridor floor


Next, we will create the corridor walls and ceiling.

First, let’s create the walls. Click Create>3D Object>Cube and create 2 cubes. Set the Position to (10, 2, 1.5), Scale to (10, 4, 1).

For the opposite road, duplicate road-left and set the Position to (10, 2, -1.5).

Next, let’s create the ceiling. Click Create>3D Object>Cube and create a cube. Set the Position to (10, 4.5, 0), Scale to (10, 1, 4).

The corridor is done now, and 2 rooms with a corridor between them has been created.


Complete image of area

Duplicate the rooms and corridor

Duplicate the room

Duplicate the room and create enough rooms. I created room2 through room6 in addition for this tutorial.


Create room1 through room6


The Position of room2 through room6 is (0, 0, 0) by default, so refer to the blueprint you created at the beginning, and set positions according to it.


Paper blueprint

For example, the Position of room3 should be (20, 0, 20). The finished image should be like in the image.


6 cube positions

Duplicate the corridor

Connect the 6 rooms with the corridors. Create 4 duplicates of the road.


Duplicate road

The vertical corridors can be used without changing the direction, so we just need to change the Position. Refer to the blueprint for the Positions. the position of the corridor between room3 and room4 is (10, 0, 20).


vertical corridor

The sideway corridor has to be rotated 90° before we set the positions. For the Position and Rotation for road4 and road5, please refer to the following image. This is according to the paper plan too.

road4 Inspector values


road5 Inspector values

Each room is connected now.

Although the corridors and rooms are connected, some are without holes, so let’s take care of that next.


Place a side corridor

Edit the closed wall

For the room front and back, we can use the exit we used in the previous steps, so duplicate it and use it.

But for the right and left, the Scale needs to be different, so we need to change it.

So, let’s create a wall with holes for right and left.

Create Empty and name it ‘side-exit’. Set the Position to (0, 0, 0).

Inside side-exit, use Create>3D Object>Cube to create ‘side-exit-right’, ‘side-exit-left’, and ‘side-exit-top’.

Set the side-exit-right Position to (-3.25, 5, -5), Scale to (4.5, 10, 1).

Set the side-exit-left Position to (3.25, 5, -5),Scale to (4.5, 10, 1).

Set the side-exit-top Position to (0, 7, -5), Scale to (11, 6, 1).

Now, side-exit is complete.

Switch left of room 5 with side-exit.

Place side-exit under room3 and room5, and we’re done.

Then, use Create>3D Object>Cube for room3, and create ‘front’ (with Position(5, 5, 0), Scale (1, 10, 10)), and delete right for room3, left for room5.





We are done with all steps now. 6 rooms are created.

When uploading to STYLY, it’s annoying to upload each room and road separately, so you can use Create Empty, name it ‘maze-boxes’, and put all rooms and roads under it.

このときmaze-boxesのPositionが(0, 0, 0)になっているか確認してください。

Upload to STYLY

Let’s try uploading to STYLY. To learn how to upload assets from Unity to STYLY, please refer to this article.

Place objects in STYLY

Let’s place objects in the uploaded rooms in STYLY.

The coordinates in Unity are linked to those in STYLY, so we can use them directly.

For example, Unity Position (20, 0, 0) is the same as STYLY Position (20, 0, 0).

We can use this to place objects where we want.

Let’s try placing an object in room2.

Place a object in STYLY, then set the Position to (20, 0, 0).

Then, the object moves to room2. The room is not transparent, and it is hard to locate the object, so press the F key and move to where the object is. By using this procedure, we can easily place objects wherever we want.


Moving objects in STYLY

How was my article?

We used only 6 rooms for this tutorial, but if you duplicate a room, or make the corridor longer, you can create various types of constructions.

If you use the duplicate option in Unity, it is very easy and simple to create more rooms, so I hope you try and make your own maze or house using this article’s techniques.