How to import an OBJ into Unreal Engine
Part of The OBJ file format, explained for game engines
Unreal works in centimeters, and Unity, Godot and Blender all default to meters, so the first thing an OBJ does in Unreal is arrive a hundred times too small. This article goes through the import dialog setting by setting, and then what to do with the mesh once it's in. The gaps in the OBJ format itself, units and axes among them, are covered in the OBJ guide. Unity and Godot have their own articles, and OBJ, FBX, GLB or STL is there if you're still choosing a format.
The import
- In the Content Browser, press Import, or drag the
.objinto it. Keep the.mtland any texture in the same folder as the.objwhen you do. - The FBX Import Options dialog appears, because Unreal uses the same dialog for OBJ. Set the options described below and press Import, or Import All if there are several files.
- Drag the resulting Static Mesh into the level.
In Unreal 5.x with the Interchange framework enabled, the dialog looks different but the same settings are in it under the same names.
The scale
Unreal's unit is the centimeter. An OBJ has no unit, and a model made in meters, as almost every game model is, comes in a hundredth the size. In the dialog, under Transform, set Import Uniform Scale to 100. A model made in centimeters needs 1, and one made in millimeters needs 0.1.
If it's already been imported small, open the Static Mesh, set the scale in its details under Import Settings, and press Reimport Base Mesh. For one instance it's quicker to scale the actor in the level. A scaled actor scales its collision and confuses physics and lighting, though, so the reimport is the better fix.
The up axis
Unreal is Z-up and most OBJ files are made Y-up. Under Miscellaneous, Convert Scene is on by default and rotates a Y-up model so it stands up in Unreal. Leave it on for any Y-up file. That includes OBJ files from Blender, whose OBJ exporter writes Y-up by default even though Blender itself is Z-up. Force Front XAxis turns the model to face Unreal's convention of +X forward. Turn it on if the model's front should face that way. For a tree it doesn't matter.
Normals
Under Mesh, Normal Import Method has three values. Import Normals keeps the normals in the file, which is what you want for a file with flat normals. Compute Normals throws them away and calculates smooth ones, and on a low poly model that gives the balloon look. Import Normals and Tangents also takes tangents from the file, which an OBJ doesn't have. Set it to Import Normals for a file that has normals in it.
If the file has no normals, Unreal computes them whatever the setting says, and the model comes in smooth. The fix is a file with normals in it. The flat shading guide explains why, and the same reasoning applies here.
Materials
Under Material, Material Import Method decides what Unreal makes from the .mtl. Create New Materials makes a material per newmtl, Create New Instanced Materials makes instances of a base material, and Do Not Create Material gives every slot the default gray. Import Textures brings in the map_Kd textures it can find beside the file. For a palette-textured model, Create New Materials with Import Textures on gives one material with the palette as its base color, which is what you want. Set its Roughness to 1 and its Specular low so the flat color doesn't look wet.
The mesh gets a material slot per usemtl. They're listed in the Static Mesh editor under Material Slots, where you can swap any of them.
Collision
Generate Missing Collision under Mesh adds simple collision to the mesh, a box or capsule. That's fine for a prop, but for a tree the box covers the whole canopy, so the player can't walk under it. Turn it off for trees and add a capsule for the trunk in the Static Mesh editor: Collision menu, Add Capsule Simplified Collision, then size it to the trunk.
Levels of detail
Levels of detail have their own guide, LODs and billboards for low poly models. In Unreal they're in the Static Mesh editor, where LOD Settings has Number of LODs. Set it to three and Unreal reduces the mesh itself for LOD1 and LOD2, with a percentage of triangles per level and a screen size at which each is used. On a low poly model, automatic reduction is fine for LOD2 and rough for LOD1, because it removes the facets. To use levels made by hand, use LOD Import to import each file as a level: LOD Settings, LOD Import, Import LOD Level 1, and choose the file. PolyMason's export includes LOD1 and LOD2 as separate files for this.
Nanite
Nanite is Unreal's virtual geometry for meshes of millions of triangles. It wasn't built for a low poly tree of three hundred. Enabling it, with Build Nanite in the dialog or in the Static Mesh editor, costs more than it saves at that size. Leave it off for low poly work and use Unreal's ordinary LODs and instancing.
Many trees
For a forest, use Instanced Static Mesh or Hierarchical Instanced Static Mesh components, or the Foliage tool, which paints instances and handles LOD and culling per instance. One material per tree keeps every instance in one draw call per level of detail, and the palette texture is what lets a tree have only one material.
What PolyMason's files need
Set Import Uniform Scale to 100, leave Convert Scene on, set Normal Import Method to Import Normals, and keep the .mtl and palette PNG beside the .obj so the material and its texture come in. Everything else on the dialog can stay at its default.
More in this guide
- The OBJ file format, explained for game enginesWhat's in an OBJ file and its MTL, what it leaves out (units, axes, colors), how it compares with FBX, GLB and STL, and how to import one into Unity, Godot and Unreal so the model doesn't arrive tiny, sideways or gray.
- OBJ vs FBX vs GLB vs STL: which format, and whenThe four formats a game or a printer will ask for, what each one can and can't carry, how Unity, Godot and Unreal read each, and which to ask a pack for. There's one table, then a section on each format.
- Import an OBJ into Unity: size, color, shadingThe steps for getting an OBJ and its materials into Unity, the Scale Factor and Convert Units settings that make a model the right size, what to do when a model arrives a hundred times too big, the Materials tab, normals for flat shading, and colliders.
- Import an OBJ into Godot 4 as a mesh or a sceneThe steps for putting an OBJ and its MTL into a Godot 4 project, the difference between importing it as a mesh and as a scene, scale, materials, reimporting after a change, generating LODs, and adding collision.
Or build a tree and see what comes out.