Now, it's great that we have a layout, but just a floor plan would get really boring really quickly in a first-person game. Luckily, we have a number of props that we can use to spice up the level a bit and add additional detail to our world. Perform the following steps:
Models/Props
folder and select all of your models. Under the Model tab, check the Generate Colliders option, and click on Apply.This will create collisions for all the objects that we want to use. We didn't choose to generate colliders for the modular pieces because we will generate them from scratch for our rooms.
0
, 0
, 0
) from the Transform section. To focus on the object, select it in Hierarchy and then press the F key (this only works if the scene is selected). Alternatively, you can also double-click on it. You'll note that in spite of being in the center of the world when the position is reset, the bed is off on the X axis, and that's again because of the art that we were provided with.0
, 0
, 0
), then select the actual mesh for all of them by holding down the Ctrl key (Command on Mac), selecting them, and then setting the material.You'll note that the material fits really nicely with the models that were created. This is because the artist who created this used a UV map to tell the engine how to cut up the material and place it onto the faces that make up the object (the vertices). The texture that we have on the material is drawn in such a way that it has the appropriate part of the image at the right place. Setting up the UVs of an object is something that is done in a 3D modeling program, but when we load the model file, it contains this information.
Take a look at the screenshot following the next information box.
For more information on UV mapping, check out http://en.wikipedia.org/wiki/UV_mapping.
Props
folder, as shown in the following screenshot:chair
. Drag and drop a chair
object in your level; you should note that it automatically gets placed on the floor at the right position, aside from the pivot looking quite out of place. Take a look at the following screenshot:0
, 0
, 0
) and Scale to (0
, 0
, 0
). Then, we'll use Vertex Snapping to move the bottom of the chair's leg to be at (0
, 0
, 0
), so it looks like it does in the following image. Feel free to hide other objects in the scene to make it easier to see by selecting them in Hierarchy and then toggling the check by their name in the Inspector:FixedChair
, and have the previous Chairs be the child of our new one. After this, create a prefab named Fixed Chair
in our Prefabs
Props
folder and then delete it from Hierarchy.chair
in. As I'm sure that you can see, it's much easier to place them now. Take a look at the following screenshot:We now have the first story all fixed; let's now show how simple it is to create a second level.
Level 01
.