I want to export my blender model to unity, but every time I do that, my object in unity has a wrong forward direction
I tried rotating the armature to -90 degrees in X axis, then applying the rotation, and then rotating it back to 90 degrees without applying the rotation, but that doesn't help in my case.
One thing that I noticed when trying to fix the problem, is that when other people rotate their objects to -90 degrees, they get their object facing top
But when I do the same thing, my object rotates like this
I've tried importing to unity both as blender file and FBX, and also tried setting forward direction to different axis when exporting as FBX file, but the result is always the same in Unity. I know there is a method in unity of creating an empty gameobject and putting the model in it with right direction, but I really want to fix my model in blender rather than doing that.
CodePudding user response:
Blender has a different axes order. When exporting, you have the option to export with Y axis up.
Hope it helps.
CodePudding user response:
This is an expansion on Zivdo's answer:
In Blender, Y is forward and Z is up (yes, this means we all do our modeling with the model facing backwards), but in Unity, Z is forward and Y is up. Thus when creating an exporter, it's simply a matter of swapping the Y and Z values in the vectors (a little more for quaternions and matrices). This is why the fbx exporter has the forward and up options: it takes care of the swaps for you, all you need to do is tell the fbx exporter the correct settings (and maybe ensure your model has the correct orientation (with rotation applied) in blender).