BomberUnits
...a Unity learning project
How to add Models

How To Add Models

Adding custom models requires some creativity, a bit of knowledge in modelling, and the right steps to correctly import the results to Unity. If you do not start in AssetForge, go directly to step 4. Blender will be needed anyway.

1 Create a low-poly model in AssetForge (2)

AssetForge is a good place to start a model from basic low-poly components, if you don't want to model directly in blender and just want some cool results quickly.

It is quite self-explanatory. Feel free to add some colors to your surfaces or even textures.

! Textures are currently not supported nicely in AssetForge 2. We can add them in still later though :)

When you are done, safe the model using the FBX export menu entry and choose to not merge the individual blocks.

2 Convert the exported model from textual to binary FBX

The AssetForge Export uses FBX ASCII format, which has to be converted to FBX Binary to be used in Blender. Use the "Autodesk FBX Converter x64 2013" for this. You can get this tool for free online, install, select your ASCII file to the left and save your binary FBX to the right. Be sure to select 'binary' and click 'convert'.

3 Import the FBXmodel in Blender

From any Blender project go to File -> Import -> Choose the format you need to import. This is FBX if you exported from Asset Forge earlier.

4 Refine the model in blender

Most importantly, you should try here to simplify the geometry and merge parts that should move together. You may want to create a second 'destroyed' version of your model as well. This should be composed of a collection of separate objects, which represent pieces of the original model to be thrown by an explosion.

Merging multiple objects together while getting rid of the internal 'additional geometry' is a bit tricky. Get Toni to show this to you, preferably offering cake.

While having selected faces in Edit Mode, you can select the material to be rendered for these faces to the right in the materials tab and list. You have to confirm with "Assign". This will be imported to Unity correctly to color your model with the materials you set.

Other things to do are:

  • Arrange the Meshes in a reasonable object hierarchy
  • Check the scaling fits to Unity: 1m in Blender is equivalent to 1 unit (as per default)
  • Apply all transforms
  • Set the origin of the object (normally center of mass for correct physics)

5 Import the blender model in Unity

Unity can read blender models directly. Save in blender and copy or move that file to the Assets/Models folder. Back in Unity, you can set some import options, especially exporting materials from the model if you want to manipulate these further directly in Unity.

6 Create a prefab to spawn the model

  1. Drag the imported model to a scene (to make an instance of it).
  2. Right-click -> Unpack Prefab for this object to sever the connection to the imported model.
  3. Drag the object to the folder structure, to create a new prefab. These go to the Assets/Prefabs folder.
  4. You can continue to customize your prefab as needed. Examples:
    • Placing the model underneath a new prefab root parent and fixing the relative positioning.
    • Adding more components
    • Removing camera and light objects that came from blender.
    • Modifying the extracted materials to get the looks you like in Unity (a bit different to Blender looks).