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:
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:
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:
Lets see how Collision can be added to our object:
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:
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:
Here's how you can generate a Lightmap for your object:
1
.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:
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!
18.219.71.21