Blender is a free, open-source 3D modeling tool that lets artists create characters, animations and props. Blender’s accessibility makes it ideal for prototyping and asset creation amongst indie devs and studios. Finalized assets and modeled props are exported from Blender and imported into game engines, like Unity. Devs create the model first, with textures and animations where necessary, then export the model in Unity’s supported file formats.
Importing models to Unity lets devs configure them, such as adjusting the lighting or fixing the scalings. Prefabs are available in Unity too so devs need to import a model only once before they’re able to create duplicates of it for reuse. Keep reading for a full overview on exporting models from Blender and adding them into Unity’s asset folder, along with how to add textures and create Prefabs.
1. Export the model from Blender as an FBX/OBJ file
Export the model from Blender as an FBX or OBJ file since Unity doesn’t read Blender files (.blend). Animations or advanced materials (other than default maps like base color) have a chance of not working correctly when imported as .blend files so export models in a format Unity is able to understand. To export the model, open the file in Blender, then go to Export. From the format options given, pick either FBX (.fbx) or OBJ (.obj) and then adjust the settings for the scale and animation. Save the file and lastly, import it to Unity.
The FBX and OBJ formats are recommended because both help preserve geometry, with support for different asset data. FBX supports texture maps and preserves animations and any parent-child relationships you’ve added during the export, as well as bones and animation curves, ensuring models move as intended. OBJ doesn’t support rigging or skeletal data but consumes less storage space than FBX, so it’s ideal for optimization, specifically mobile games. The rule of thumb is to use FBX for moving models or multiple UV sets (e.g. one for textures and another for lightmaps). OBJ is recommended for static models like environment props or weapons.
Blender units aren’t always the same as Unity units; make sure the model size matches Unity’s world scale so your asset doesn’t suddenly take up the entire screen. Export settings you need to keep an eye on include the scale, animation, transforms and materials. For animations, export in FBX and tick the ‘include animation’ option for Unity to get the movement data. Make sure all the rotations are correctly baked into the model before exporting. Lastly, check all the textures, since these need to be unwrapped from the model and might need to be exported separately (otherwise the model shows up without color and details).
2. Place the FBX into the Assets folder
Place the FBX into the Assets folder (import the asset from local storage to Unity) since Unity looks there for all game content. Unity is able to load the FBX model into the game once the model is dragged into the folder, after which it’ll appear in the Project View. Project View shows everything inside the Assets folder, similarly to a library. To see the model in Unity, drag the model from Project View into Scene View, which is where the game world is being built.
Unity automatically imports .fbx files via its internal FBX importer, including the mesh data (the 3D skeleton of the object), bones and animations. FBX files contain unnecessary data that the importer strips away for optimization without affecting the actual metadata, according to research from Jeong and Kim (2019). Blender has to be at version 2.60 or later for this to happen, though. Unity’s import settings have a Bake Axis Conversion option that makes sure all the models face the right way up, but it doesn’t always work with FBX files from Blender.
Blender uses a Z-axis point up whereas Unity uses a Y-axis point up, so exports have a chance of rotating the wrong way, like turning up on their side. Devs are recommended to use add-ons from GitHub if their models end up this way despite using Unity’s tool. Add-ons solve the axis conversion issue by exporting with the right orientation, so your model faces the way you want it to.
3. Adding textures and texture maps to material that you use for the model
Adding textures and texture maps to material that you use for the model means adding skins like wood, metal or real skin for characters. Texture maps help add realism and stylization since they create surfaces that look how they feel, such as bumps for rocks or smooth shiny surfaces for metal. It’s not possible to export models from Blender with their textures without unwrapping them from the model first and exporting separately. Devs need to choose between that or creating the textures directly in Unity.
Add textures and texture maps to your model by first creating a material in Unity, which is a container that holds all the surface’s properties. Blender lets you scan nearby surfaces or choose an existing image file to act as the base color texture, before throwing in the fine details. Assign a texture image to the material’s Base Color/Diffuse Map slot which is found in the Base Color channel under Unity’s Material settings. You’re able to then apply the material to your model by dragging it onto the mesh in Scene View. For prefabs, don’t change the texture directly in Scene View, instead go to Prefab editing mode and change the texture there. This makes sure changes are applied to all the clones.
The last step is to add texture maps, which is similar to spreading out animal skin carpets on the floor. Texture maps are based on UV coordinates, which wrap 2D images onto 3D surfaces (like your models). Artists are able to cut the mesh in certain places and then spread it out on the 2D plane. This helps figure out where mesh details are going to be reflected, making sure of details like wood grain aligning correctly on a chair. There are six types of texture maps that have been expanded on below, including the Base Color/Diffuse Map.
- Normal Maps are the go-to since they add bumps and dents without increasing the polygon count
- Metallic Maps control how metallic a surface is, like the extent to which it reflects light and color
- Roughness Maps control the smoothness or roughness of surfaces (like wet, smooth pavement vs. old-looking, jagged bricks)
- Height/Displacement Maps push or pull the surface geometry to add depth
- Base Color/Diffuse Maps let you apply the same base color from an image to all similar models (like how all of Minecraft’s grass blocks are green)
Height/Displacement Maps are typically used in film since they help with offline rendering and make terrain look realistic. Video game devs prefer Normal Maps since they’re cheaper and reduce performance strain. Normal Maps essentially fake surface detail, giving the illusion of realism, and are therefore ideal for real-time rendering.
4. Create a Prefab from the configured model
Create a Prefab from the configured model so the same model is reusable across the game world. Drag the finished model, complete with any textures or settings, from the Scene folder to the Assets folder where the Unity engine creates the Prefab file. Devs are able to drag the model into any scene again and again after this. Prefabs also make sure all the clones copy changes made to one which saves time.
Prefabs come in useful for game design since games have multiple repeating objects, like treasure chests. Devs are able spawn Prefabs during gameplay using scripts like in Diablo, where treasure chests are instantiated from Prefabs whenever the game drops loot. Unity’s documentation also shows support for real-time updates of the objects across multiple scenes.