6
$\begingroup$

When exporting models from Blender into Unity one must take into account the handedness of both programs.

Blender considers Z vector as the UP vector, but Unity considers the Y vector as the UP.

Now, if you want a model who is facing up in Blender (along Z) to be facing up in Unity (along Y) when imported, people recommend this simple fix:

  • model your 3D model in Blender along the Y axis and apply the necessary rotation onto the model.

enter image description here

Now when working in Blender if you want to use Z as the UP vector, you simply transform your model by a positive 90 degree rotation around X (but don't apply the rotation).

enter image description here

I export my model using Blenders built-in FBX exporter with the default settings (UP = Y axis and FORWARD = -Z axis).

When imported into Unity, my model is facing upwards as expected along the Y axis. enter image description here

But, what I don't understand is why my model is also rotated 180 degrees around the Y axis?

In the first image from Blender you can see that my cup handle pointed along the x axis aka right, but now is facing left (-X direction).

$\endgroup$
3
  • $\begingroup$ My team recently stopped exporting FBX from Blender to Unity because of scaling issues with nested objects. Instead we use .blend files in Unity. You'll notice that when you use .blend instead of FBX, the Scale Factor will be 1 as expected. A big part of the decision was because Blender cannot keep up with changes in the FBX format. Blender rolls their own binary interpreter since they cannot incorporate the closed-source FBX SDK into their distribution. The !EXPERIMENTAL! Apply Transform function worked for orientation in some simple cases but development on that has ceased AFAIK. $\endgroup$
    – sbsmith
    Commented Mar 30, 2017 at 20:36
  • $\begingroup$ If you go the .blend route and want to get the nice "export selected" functionality for .blend, see this question blender.stackexchange.com/questions/71031/… $\endgroup$
    – sbsmith
    Commented Mar 30, 2017 at 20:38
  • 1
    $\begingroup$ Oh, and we fix the rotation by using a custom import tool for our .blend files. It creates prefabs where the meshes are nested and re-oriented inside empty GameObjects. $\endgroup$
    – sbsmith
    Commented Mar 30, 2017 at 20:40

6 Answers 6

4
$\begingroup$

What worked for me to import into Unity is this setting:

enter image description here

Orientation in Blender:

enter image description here

Orientation in Unity: (The right direction)

enter image description here

Models: https://free3d.com/3d-model/simple-game-ready-cars-set-92718.html

$\endgroup$
3
$\begingroup$

I had the exact same problem before, and i fixed it by doing the following:

  1. Choose to export with FBX
  2. Check "!EXPERIMENTAL! Apply Transform"
  3. Import to Unity
  4. See that the model is on the correct rotation.

FBX Export

$\endgroup$
1
$\begingroup$

Just export to FBX using the defeault settings of -Z Forward and Y up.

enter image description here

$\endgroup$
2
  • $\begingroup$ I don't have Unity, so I can't test this, but in the screenshot from Unity in the question it looks like it uses Z forward and Y up. $\endgroup$
    – user27640
    Commented Sep 17, 2016 at 16:02
  • $\begingroup$ The question has been edited beyond recognition now so the point is moot. $\endgroup$
    – Xtremity
    Commented Sep 17, 2016 at 20:04
1
$\begingroup$

Every object that you want to rotate (by script) has to be shild of an Empty Object, so the script responsible for the transformation, has to change the rotation of the Empty Object.

Rotate(Vectors3.up * value) will really be the Y (Unity) axis.

$\endgroup$
0
$\begingroup$

You can also put -90 on the x axis (in blender-render), then press CTRL+A and then put 90 on the x axis (all of this inside blender) and then just export it.

$\endgroup$
0
$\begingroup$

You can use this plugin : Blender to Unity Orientation Fix Plugin

It will automatically fix the orientation of your .blend files in your Unity project. Just download and install the .unitypackage in your project, and re-import .blend files (In Unity Project tab, right click -> Reimport)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .