In this chapter, we are going to create an interior environment. This will be useful to know, because unlike a landscape, interiors are generally more structured than the outside world, with straight floors and walls where we can use 3D models modularly to build the environment!
To show how easy it is to use, let's get started. Perform the following steps:
Materials
. Then, enter the folder and create two new materials by selecting Create | New Material. Give one of the new materials the name House
and the other, Props
. Once you have created that go to your example code folder, and within the Textures
folder, import the 2048_House_TEX.jpg
and 2048_Props_TEX.jpg
files from the Example Code Assets
folder for this chapter. Once you've done that, apply that texture to the materials in the Albedo property via drag and drop. Once finished, it should look like the following screenshot:Models
.John Espiritu has very kindly provided some models in modular pieces for us to work with. So, the next thing we will do is actually import those models.
For more info on John's stuff or to commission him yourself, check out http://raynehaize.tumblr.com/ or http://raynehaize.deviantart.com/.
Models
folder selected, let's import the models by dragging and dropping the Modular Pieces
and Props
folders in it. Take a look at the following screenshot:Modular Pieces
folder in Hierarchy. At this point, it should look somewhat as follows:Ceiling 01
object, hold down the Shift key, and select the Wall Plain
object at the bottom. This will bring you to Model Importer. Once you are in the Inspector tab, you will see the following three tabs:The Scale Factor property allows you to apply a scalar to the model that you've imported. This is fine for this project, but generally, when working with animations, changing the scale factor may hurt your rig. So, be sure that you have your artist create art at the correct scale.
If left checked, Unity will have each object use its own material, which is intended to have its own texture. All of our pieces use the same texture, so there's no need to have multiple textures.
None
, and click on Apply if needed.If the object has animation, it will attempt to add an Avatar and more, which is unnecessary for this. Note that now the Animations tab will be grayed out because we have no animations.
Materials
folder inside the Modular Pieces
folder.When exporting an FBX file, it exports your model with UV coordinates but doesn't include the textures in the FBX file. You have to import your textures separately into Unity and add it to the material generated or assign it on your own.
As of this version of Unity, there is no way to have models not generate a material by default, hence we need to delete them. We will add materials to these models when we create their prefabs.
Props
folder as well. Once you finish, the folder should look like the following screenshot:Now, we have our models in the project! This is a great first step, but it's useless unless the models are actually in the game world. Let's get started with that now.