Building Engine for Unity3D - Tiny house creation part 3

3a. Create your building with the in-editor inspector

- Add portals

Before creating the rooms of the second floor, we add the portals in the rooms of the first floor. Hit the "RETURN TO STORY" to return to the Inspector of S0. Then hit the "SHOW" button next to the R0 label to go to the R0 Inspector.

We start with the double window located on the wall at NORTH. In the Inspector, hit the "ADD PORTAL" button. A Portal object is added to the building, and the P0 (first portal) Inspector appears. For the direction, choose NORTH (the default value). For the portal shape, open the selector and select windowX2. This makes the portal uses the portal architectural infos names windowX2 (a window opening with 2 units long) as defined in the builder/ArchitecturalInfos component.

Now we need to define the position of the portal. According to the floorplan, the window is located two units from the left border of the room, then the position is 2.

The position of a portal is defined by the direction of the portal. For a portal on the wall at NORTH, or on the wall at SOUTH, the position is the number of units from the left border of the room before the portal. For portal on wall at EAST or WEST, it's the number of units from the top border of the room.

We add a prop to this portal. Without prop, the portal is just a hole in the wall. In the Portal Inspector, use the selector of the "Add prop" section. Select "blackDoubleWindow" and hit the "ADD PROP" button. A Prop object is now added to the portal.

First portal

Hit the "RETURN TO ROOM" to go back to the R0 Inspector.

Hit the "REBUILD" button to recreate the building and see our portal appears.

First portal build

Let's save our buildng before continuing. Select the BuildingEngine gameObject, hit the "SAVE MAP" button. Enter "tinyHouse" in the textfield and hit "SAVE". As the "tinyHouse" saves already exists, you need to confirm. Hit the "OVERWRITE" button.

Now hit the "SHOW MAP" button, then the "SHOW" button next to the BD0 label, then the "SHOW" button next to the S0 label, and the "SHOW" button next to the R0 label.

We create the others portals of the room.

We add the door to the R2 room. Add a portal, and give the specified value : direction = EAST, shape = door, and position = 5 (5 units from the top border of the room, according to the floorplan). For the prop, choose "modernWoodDoor".

INPORTANT : when creating a portal on a wall inside a Story (ie not on the border of a story), you need to have a room where the portal can exit, otherwise the Inspector does nothing than inform you that this operation is not possible. Same when the portal is on a wall at the border of a story, but another story is adjacent at this position. If the "exit" story have no room for the portal to exit, an error appears and no portal is created.

One last thing : some prop (ie prefabs) have a direction (like a door for example). The door prefabs contained in the BuildingEngine package open in the room where they're created. But if you create your own doors, you can use the another direction. Just make sure to select the "good" room to add the portal, according to your need.

Second porrtal inspector

We add the two other Portal to the room R0. Go back to room R0 and repeat the operation :

- direction = SOUTH, shape = windowX2, position = 2, prop = "blackDoubleWindow"

- direction = WEST, shape = windowX2, position = 3, prop = "blackDoubleWindow"

Go back to the room R0, then then the story S0, select the R2 room and add the following portal :

- direction = SOUTH, shape = door, position = 1, prop = "modernWoodDoor"

Then go to the room R3, and add these portals :

- direction = NORTH, shape = doorX2, position = 1.5, prop = "glassBlackMetalDoorX2"

- direction = EAST, shape = windowX2, position = 1, prop = "blackDoubleWindow"

- direction = EAST, shape = windowX2, position = 5, prop = "blackDoubleWindow"

- direction = SOUTH, shape = windowX2, position = 2, prop = "blackDoubleWindow"

- direction = WEST, shape = door, position = 5, prop = "modernWoodDoor"

All the portals of the firts floor are now created. REBUILD your building and SAVE MAP.

First floor with portals

Next >>

© 2017 Magyc Pixel. All rights reserved | Design by W3layouts