How to import an OBJ into Unity
Part of The OBJ file format, explained for game engines
Unity imports an OBJ the moment it lands in the Assets folder, and most of the time there's nothing more to do. This article has the steps, and then the things that go wrong, which are size, orientation, color and shading. What an OBJ carries and what it leaves to the importer is in the OBJ guide. There are matching articles for Godot and Unreal, and if you haven't settled on a format yet, OBJ, FBX, GLB or STL compares them.
The import
- Put the
.obj, its.mtland any texture it names in the same folder, and drag the folder, or the files together, into the Project window. Unity imports the OBJ as a model asset with a mesh per object and a material perusemtl. - Drag the model asset into the Scene or Hierarchy. It arrives as a GameObject with a child per object in the file, each with a Mesh Filter and a Mesh Renderer.
- Look at it. If it's the right size, in color, and shaded the way you expect, you're done.
The wrong size
An OBJ has no unit, and Unity reads its numbers as meters. A model made in meters arrives at the right size. A model made in centimeters arrives a hundred times too big, and one from a tool that exported in millimeters arrives a thousand times too big.
Fix it on the model asset, not on the GameObject. Select the .obj, open the Model tab, and set Scale Factor to 0.01 for a file in centimeters or 0.001 for one in millimeters. Press Apply. Scaling the GameObject works too, but then the scale travels with the object, scales its children and colliders, and confuses anything that reads its transform.
The Convert Units checkbox below it only applies to files that state a unit. FBX files do and OBJ files don't, so for an OBJ it does nothing.
The famous case, a Blender model arriving a hundred times too big, is an FBX problem. Blender's FBX exporter writes centimeters by default and Unity's importer reads them, and the fix is Convert Units or a scale of 0.01. Blender's OBJ exporter writes meters and needs no fix.
The wrong way up
Unity is Y-up, and an OBJ says nothing about which way is up. A model exported from a Z-up tool with the wrong settings arrives on its side. Re-export it with the exporter's forward and up options set for Y up. In Blender's OBJ exporter that's Forward -Z, Up Y, which is the default. If you can't re-export, rotate the GameObject by -90 on X and make it a child of an empty, so the rotation is hidden from the rest of the scene.
Gray where it should be colored
A gray model means the .mtl wasn't next to the .obj when Unity imported it, or the texture it names was missing. Put them together, then right-click the model and choose Reimport. Unity makes a material per newmtl and looks for map_Kd textures by file name in the same folder and its subfolders.
The Materials tab controls this. Material Creation Mode should be Standard (or Import via MaterialDescription in recent versions). None gives you a gray default material for everything. Location decides whether the materials live inside the model asset, which is Use Embedded Materials, or as separate assets. Extract Materials writes them out so you can edit them. For a palette-textured model from another source you'll often want to, so you can set Smoothness to 0. PolyMason's files don't need it. In a test import into Unity 6, the material came in as Standard with the palette texture assigned and Smoothness already at 0.
Smooth where it should be flat
The trunk looks like a tube and the foliage looks like a balloon. Either the file has no normals and Unity calculated smooth ones, or the file has smooth normals in it. On the Model tab, set Normals to Calculate and Smoothing Angle to 0, and press Apply. The flat shading guide covers this problem in full and the smoothing angle article covers that one setting. The short version is that a file with flat normals in it needs nothing, and a file without them needs the angle set.
Colliders
The importer's Generate Colliders checkbox on the Model tab adds a Mesh Collider to every mesh. That's fine for a prop. It's wrong for a tree, because a mesh collider on foliage keeps the player from walking under the canopy. Leave it off and add a Capsule Collider on the trunk by hand, or in a prefab. The tree colliders article has the details.
Read/Write and other settings
Read/Write keeps a copy of the mesh in memory for scripts to read. It's off by default, and you should leave it off unless you modify meshes at runtime, since it doubles the memory. Mesh Compression trades precision for size, so set it to Off for anything you might scale up. Optimize Mesh reorders triangles for the GPU, and you can leave it on. Import BlendShapes, Import Visibility, Import Cameras and Import Lights do nothing for an OBJ.
Making it a prefab
Once the GameObject is set up, drag it from the Hierarchy back into the Project window to make a prefab. The prefab keeps its colliders and any LOD Group. Instances of the prefab in your scenes update when the prefab changes, and reimporting the model updates the mesh without touching the prefab's settings.
What PolyMason's files need
PolyMason's files don't need any of these fixes. The tree builder writes meters, Y up, with the model standing on the ground at the origin, flat normals in the file, and one material whose texture is a palette PNG in the same zip. Drop the zip's contents into a folder and leave the importer at its defaults. That was checked in Unity 6 with every import setting left alone. The oak came in at the height it was built, with a scale of 1 and no rotation, shaded flat, with a Standard material that already had the palette texture assigned and Smoothness at 0.
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 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.
- Import an OBJ into Unreal at the right scaleThe steps for importing an OBJ as a Static Mesh in Unreal Engine 5, the Import Uniform Scale of 100 that a file in meters needs, Convert Scene for the up axis, Normal Import Method for flat shading, what happens to the MTL's materials, collision, LODs and Nanite.
Or build a tree and see what comes out.