Tuesday, May 8, 2018

Bringing your 3D Models into Unity

When you are working across multiple programs in technology, it’s important for any designer to be aware of what file formats are suitable for the program you’re using. There is nothing worse than working long and hard on making something look great in one program, and having an error on it when dragged into another!

3D is lots of fun and very straight forward to make simple models to deck out any scene in Unity, so I’m going to walk you through a simple procedure of exporting for a 3D model into Unity. My preferred 3D modelling software is Autodesk Maya but you can use any you wish, as long as you can export the model into an FBX file.

Why .fbx?
An fbx file is a 3D asset exchange format that is compatible with many 3D tools. It also enables you in most cases to save your materials on the object if desired. As opposed to an OBJ file, your capabilities are much larger.

Getting started:
Jump into Maya and create your model. I have made a simple lamp to use as an example. Note: you want your model to be on the lower side of the poly count. To keep track of the count, select Display > Heads Up Display > Poly Count. The count will appear in the top left corner.

You can apply your materials to the object in your 3D software, OR Unity. For the sake of showing you how to do so in Unity I’m going to leave my model without a material in Maya.

A few things to check before exporting:
- It is a good idea to combine your meshes. You can do this by holding the mouse and dragging a box over all the objects and selecting Mesh > Combine.
- The ‘Up Axis’ should be set to ‘Y’.
- Your model is on the ground plane, with all location and rotation values set to 0 in the ‘Attribute Editor’ panel.

Getting your model export-ready is very straight forward. Ensure the alignment is correct and everything is squared-out and facing forward toward the positive Z-Axis. When you’re ready, go to File > Export All. Select FBX under ‘Files of Type’ to export in the correct file format. Name your file and place it somewhere you can easily access when you open up Unity to import the object.

Once you’re in Unity:
Once you’ve got a new or existing scene set up in Unity, simply drag and drop into the Assets panel. Once you can see your model, drag it into your scene. You can then right click in the Project panel and click Create > Material. Now for the fun part! You can drag and drop a PNG if you’d like, or select a colour from the top right Inspector panel. It’s here you can also customise your material by toggling between the X and Y options in the tiling section.

So there you have it!
A basic guide on how to get your 3D objects into Unity correctly as well as a little bit of customisation. Happy designing!

Jacqui Leis

No comments: