Sunday, 5 January 2014

Importing from Blender to Unity

Here are the answers to the most frequently asked new-b questions.

Q: How do I export/import an asset?
A: In Blender, go to File > Export, and save it directly into the Assets folder in your Unity project folder. Unity will automatically detect the new item and list it in the project browser. Click and drag to your scene to add it. I usually export to .FBX (it is the only one that support animations?)

Q: The orientation is incorrect.
A: While exporting, on the left pane, make sure that Forward is set as -Z Forward and Up is set as Y Up.

Q: The imported asset is too small.
A: Click on your imported model in the project browser. In the Inspector, select Model and change the scale factor accordingly.

Q: How do I use an animated model?
A: If you just drag and drop the model into the scene, it will not run when you press Play. Notice that the newly created instance has a slot for animator controller (find it in the Inspector). It is set to None. In short, you need to create an animator controller and link it here. For more details, check out tutorial 202 of the stealth game on the Unity website.

Q: I want my animation to loop forever.
A: Click on your imported model in the project browser. In the Inspector, tick the Loop Time check box in the Animations pane (next to the Model pane).

Q: I rotated my animated model in Unity. However, when I press Play, the rotation is gone!
A: A quick workaround is to create an empty game object (same place where you create cubes and stuff) and drag and drop the instance of your animated model onto the empty game object in the hierarchy. Then, instead of applying the rotation (or other transforms such as scaling) on the instance, apply it on the game object.

No comments:

Post a Comment