Setting up and using our new 3D asset

Now that we have our FBX file, we need to import the file into the Content Browser in Unreal. Epic Games has made this a relatively painless process. After we import the file into the game engine, it still needs two more things. A collision mesh will have to be added to make sure that the player and other game object collide correctly with our new crate. Second, we will have to add a material to our object to give it visual appeal.

Start by navigating in the Content Browser to the folder you would like to store your crate in and clicking the Import button:

Setting up and using our new 3D asset

Find your FBX file in the file browser.

  1. Navigate to the folder where you saved your FBX file and click Open:
    Setting up and using our new 3D asset

    Unreal's FBX Import Options menu

  2. This opens the FBX Import Options. Turn off the Auto Generate Collision option. Though this can save us time in the future, we will create this manually after we have successfully imported the file.
  3. Also turn off the Import Materials and Import Textures options. These can be used if you have created a material in your 3D package and want to bring it in along with your object. If we were to use it in this case, Unreal would import our colored UV grid.
  4. Once you have changed these options, click the Import button.

A light blue icon showing our crate should be added to the Browser. Double clicking it will take us to the Static Mesh editor. Here, we can set several different options that will affect every copy of the crate we use in the level:

Setting up and using our new 3D asset

Static Mesh Editor within Unreal 4

We will start by adding a collision primitive. Collisions are really what make video game worlds go round and it is the way that the computer knows if a player has successfully interacted with another game object. As players, we often see collision when we stand on a platform and look down. It often looks as if we are floating just above the actual object we are standing on. This is due to the fact that the game programming actually ignores the art that the player sees and only uses the simple collision primitives that are invisible to the player to record hits. As far as we are concerned as level builders, a collision will keep the player from walking through our crate and make it so they can actually interact with it:

Setting up and using our new 3D asset

Select the Collision menu and choose Add Simple Box Collision

Lets see how Collision can be added to our object:

  1. Make sure the Collision option is turned on along the top of the viewport. This will make any collision primitives we create visible.
  2. Click the Collision menu option in the menu bar along the top of the screen. From here we will want to select the simplest shape that fits our needs. Since our crate is really just a box, we will select Add Simple Box Collision. You should now see a box outlined in green around the crate.

The next thing we need to do is select a material to add to our crate. Any of the materials available in the Content Browser can be used:

Setting up and using our new 3D asset

Adding a material to our box using the Details panel

  1. Go back to the Content Browser and navigate to the Materials folder inside the Starter Content folder.
  2. Click on the material you would like to use for the crate. I selected M_Metal_Copper.
  3. With the material highlighted, go back to the Static Mesh editor and click the small arrow next to the material sphere in the LOD 0 section of the Details panel. Whenever you see a small arrow like that in the Unreal Engine, clicking will allow you to use whatever you have selected in the Content Browser.
  4. Your material will appear on your crate. Feel free to try a few different options to find what you think works best.

For our next game asset that we will create later in this book, we will use a custom material that will really make the object stand out. Once we have the material setting complete, there is only one more setting that we need to change. Unreal likes to generate its own UV channel for storing lighting information. However, back in Chapter 3, It's Time to Customize!, we created our own using Blender's Lightmap Pack feature, and we want to tell Unreal to use it, since ours is quite a bit better:

Setting up and using our new 3D asset

Telling Unreal to use our Lightmap we created within Blender

Here's how you can generate a Lightmap for your object:

  1. Under the LOD 0 section of the Details panel, find the Generate Lightmap UVs option and turn it off. This tells Unreal that we do not want it to create its own UV channel for lighting information.
  2. Find the Source Lightmap Index setting. This tells Unreal which UV map to use when doing light calculations. Change this setting to 1.
  3. Finally, go to the Destination Lightmap Index and change this to 1 as well. This tells Unreal to record the light and shadow information on the UV channel that we created.

Done! Our crate is ready for use:

Setting up and using our new 3D asset

The final crate inside our level. Congratulations!

Take a few minutes and replace a few of the cubes in the cargo bay with our new game asset. To really add some variation, try scaling a few of them up or down. Once the area is decorated to your liking, remember to save your level and press the Build button. Now drop into your level and check out the space!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.71.21