Level Design in Unity 3D Part 2: The Walls
Now that the game scene has a floor to stand on, walls are the next logical step in the process!
Using the same asset bundle from Filebase, these floor tiles can be used to make matching walls for this room. A new floor tile variant is dragged into the hierarchy, and rotated upwards by holding the control key, to snap the rotation to whole increments.
This will be the base object of the first wall variant, so a new empty object is created to act as a parent.
The initial Sci-fi floor is dragged into the empty wall as a child object.
Changing this Pivot and Center button is very useful when if comes to rotation and repositioning. As seen here Center has the default Center of the object, while Pivot moves the “center of rotation and position” of the object to the edge.
A second tile is placed over the first and moved into place using Vertex Snapping. To use Vertex Snapping, first select the object you want to snap into place. Press and hold the V key, and the cursor will snap to the different vertices of the selected object. Left click on the vertex you wish to snap to position, and then drag it towards the vertices on the object you want to snap it to. Release the left click and V key once the object is snapped into position.
Using a few different game objects, I now have an interesting looking wall object.
I will want to use this wall segment multiple times, so let’s make it a Prefab.
The solid 3D cube shows that the wall is now stored as a prefab, which means it can now be used in multiple instances, and edited via the original prefab.
A fast way to create variations from a prefab, is to drag it into the hierarchy and then Unpack it.
The original Wall_01 prefab is still stored and safe for future use. This unpacked prefab can be manipulated and resaved as a prefab variant.
The Wall_01 prefab is dragged to the side for comparison, and the new Wall_02 object is built in the same fashion as it’s predecessor.
Using the Pivot option is useful for aligning the bottom wall segments.
Here is the completed Wall_02 segment next to the Wall_01.
The Wall_02 game object can now be made into a prefab, adding to the small collection of wall objects ready to design with.
Vertex Snapping can be used to position the wall adjacent to the floor tiles.
The two wall prefabs are now duplicated and placed into position in the scene view. This clip shows the difference in rotation concerning the Pivot option compared to the Center option.
This is the scene after placing the wall elements around the perimeter of the floor.
I hope you will join me in my next article where I begin to add columns and archways to further enhance the game scene. Thanks for reading!