Blender import rotation incorrect

I have created a model in blender.

I placed the .blend file into the assets directory and Unity performed its magic on it generating some game objects that I can use to display and manipulate the mesh. But something is slightly awry…

Here is what I see:

  • The game objects are created alongside the blend file (there are multiple named objects in the blend file and they are all created as gameobjects, 3 to be precise)

  • When I select the object in the project view I see the whole mesh in its little window at the bottom of the inspector. But it is on its front instead of standing up which is how I have it in Blender. No doubt this is something to do with the y-up z-up differences between Blender and Unity.

  • But when I drag the asset into the scene it is the right way up. Well ok I can live with this, if the asset is going to render the correct way up then great. However…

  • When I run this code:

    myImportedObject.transform.rotation = Quaternion.LookRotation(directionImMoving);

… then the object is immediately flipped onto its front (in an x=90 degrees rotation), but still rotates as I would expect except that it is lying on its face and not standing up.

I’m not sure if the problem lies in my Blender file or Unity.

Note: my .blend has no unapplied transforms/rotations etc…

http://forum.unity3d.com/threads/blender-unity-rotation-fix.181870/