Meshes

Reference Manual > Components > Asset Components > Meshes

Meshes make up a large part of your 3D worlds. You don't build your meshes in Unity, but in another application.

In Unity, we have done everything in our power to make this process as simple as possible. There are a lot of details, but the following pages should address all specificities of the common 3D art packages:

How do I import objects from my 3D app?

Unity supports importing from most popular 3D applications. Choose the one you're working with below:

Other applications

Unity can read .FBX, .dae, .3DS, .dxf and .obj files, so if your program can export to this format you're home free. FBX exporters for popular 3D packages can be found here. Many packages also have a Collada exporter available.

Hints

  • Store textures in a folder called Textures next to the exported mesh. This will guarantee that Unity will always be able to find the Texture and automatically connect the Texture to the Material. For more information, see the Textures reference.

See Also

Textures

Unity will attempt to hook up materials to your imported scenes automatically. To take advantage of this, place your textures in a folder called "Textures" next to the scene file, or in any folder above it.


Place your textures in a Textures folder at or above the asset's level

Import settings.

To access the Import Settings for a 3D mesh file, click the Settings button in the Project View, or Control-click a scene file and select Import Settings....


The Mesh Import Settings dialog
Share MaterialsEnable this to generate material files near the found texture files. When enabled, different scenes will share the same material settings when they use the same textures. For the precise rules, see Material Generation below.
One Material for...This will generate materials per scene, so only this scene uses them.
Don't generate materialsThis will not generate materials at all.
Mesh Scale FactorUnity's physics system expects 1 meter in the game world to be 1 unit in the imported file. If you like to model at a different scale, this is the place to fix it.
Meshes have collidersIf this is enabled, your meshes will be imported with Mesh Colliders automatically attached. This is recommended for background geometry, but never for geometry you move about. For more info see Colliders below.
Automatically calculate normalsEnable this to automatically generate normals for the imported geometry. If enabled, the Smoothing Angle sets how sharp an edge has to be to be treated as a hard edge. The smoothing angle is also used to split normal map tangents.
Split tangents across UV seamsEnable this if bumpmap lighting is broken by seams on your mesh. This usually only applies to characters.
Swap primary and secondary uv channelUse this if Lightmapped shaders pick up wrong UV channels.
Animation optionsControls how animations are imported:
No AnimationNo animation or skinning is imported.
Animation in rootAnimations are stored in the scene's transform root objects. Use this when animating anything that has a hierarchy.
Animation in original rootsAnimations are stored in root objects of your animation package (these might be different from root objects in Unity).
Animation stored in nodesAnimations are stored together with the objects they animate. Use this when you have a complex animation setup and want full scripting control.
Bake IK & simulationWhen using IK or simulation in your animation package, enable this. Unity will convert to FK on import.
Keyframe reductionPerform keyframe reduction on imported animations. You should always use this, as it takes less memory and is faster.
Split animation into multiple clipsIf you have multiple animations in a single file, here you can split it into multiple clips.

Material Generation

Materials are found based on the following rules:

  • Unity gets the name of the main diffuse material bound to the objects in the scene.
  • Unity looks for a material with this name in a Folder called Materials next to the scene.
  • Unity goes up the project folders, looking for the Material in each Materials folder along the way.

If Unity can't find the Material, it tries to create one from the texture:

  • Unity checks for a texture with the correct name in the same folder as the scene.
  • Unity checks for a texture with the correct name in a folder called Textures next to the scene.
  • Unity goes up the project folders, looking for the correct texture in each Textures folder along the way.
  • If Unity finds the texture, it creates a Materials folder next to it and creates a material in there.

Colliders

Unity features two primary types of colliders: Mesh Colliders and Primitive Colliders. Mesh colliders are imported together with your geometry and are used for background objects. When you enable Meshes Have Colliders in the Import Settings, a Mesh collider is automatically added when the mesh is added to the Scene. It has become solid as far as the physics system is concerned.

If you are moving the object around (a car for example), you can not use Mesh colliders. Instead, you will have to use Primitive colliders. In this case you should disable the Meshes Have Colliders setting.

Animations

Animations are automatically imported from the scene. For more details about animation import options see Character Animation chapter.

Normal mapping and characters

If you have a character with a normal map that was generated from a high-polygon version of the model, you should import the game-quality version with a Smoothing angle of 180 degrees. This will prevent odd-looking seams in lighting due to tangent splitting. If the seams are still present with these settings, enable Split tangents across UV seams.

If you are converting a greyscale image into a bumpmap, you don't need to worry about this.

Hints

  • Merge your meshes together as much as possible. Make them share materials and textures. This has a huge performance benefit.
  • If you need to set up your objects further in Unity (adding physics, scripts or other coolness), save yourself a world of pain and name your objects properly in your 3D application. Working with lots of pCube17 or Box42-like objects is not fun.
  • Make your meshes be centered on the world origin in your 3D app. This will make them easier to place in Unity.