- Home /
XYZ axes between Unity and Blender not matching
I'm having a really tough time trying to get my model's alignment right in Unity. I can set it in Blender where the Y axis is up and the Z axis is forward, but when I import it to Unity, the axes are completely different and I can't seem to fix it. Is there a trick or something I'm missing?
I resorted to rotating in Blender then applying rotation before export.
There's something strange with my Blender axes, as well. Y isn't pointing up in relation to the grid. What have I done with my Blender?
You need to correctly set your Up and Forward DURING the FBX export process, in the left hand column.
I'm not even exporting to FBX, I'm just using .blend files. Is that what I'm doing wrong?
EDIT: I just exported to FBX with those settings, but no models shows up in Blender.
FBX works better than .Blend in Unity. If you dont see anything check your normals in Blender.
Answer by clunk47 · Oct 10, 2013 at 07:25 PM
Be sure to apply rotation and scale in blender. Also, in Blender, if you go into EDIT MODE, select ALL verts, rotate the entire model 90 degrees on the X axis, you can get it right. You may need to experiment around w/ rotations in edit mode, but this always works for me. Otherwise, you'll need to parent your blender model to an empty gameObject.
I'm rotating everything in Blender, but even the axes seem to rotate and it gets really confusing really quickly trying to keep up with what should go where. I've literally spent about 2 hours so far just trying to get this thing positioned correctly with no luck whatsoever.
Did you try making everything one mesh (ctrl + j) in object mode, then going to edit mode, select all (A), rotate 90 degrees on the X axis (r, x, 90)? Then DON'T apply rotation (ctrl + A, rotation)... This just rotates the mesh, not the object's pivot point.
If this doesn't seem to work, would parenting to an empty gameObject be an issue? This would be the same result as parenting to an empty in Blender, then importing to Unity, and rotating only the child of the object.
This was it. I guess I wasn't rotating the model in the right mode. I was unaware of that, but lesson learned!
Answer by Jessy · Oct 10, 2013 at 05:55 PM
The axes will never match. Unity uses a left-handed coordinate system. Blender, right-handed.
AH, I see. I had this model imported before and it worked fine, except that I hadn't joined all the bits together and they didn't work properly when moving (the player controls a boat). I joined the pieces and even created a whole new model with the same results. What's the trick to getting the alignment right in Blender so that it displays and controls properly in Unity?
Find out the difference in rotation then rotate it in Blender making sure to Apply rotation.
Don't worry, there are hundreds with this problem.
"The axes will never match" is not true, so long as you get the rotation setup correctly in Blender before importing to Unity.
I applied your suggestion, and it worked in one sense...the model comes in as seen in Blender, with no additional rotation required. So it looks proper.
It doesn't work when I apply some code to the object, moving it around in X, Y, Z directions. That is still screwed up and the differences in coordinate systems seem to remain.
$$anonymous$$eep in $$anonymous$$d that I was using the .blend file. But I also had the issue with FBX. I'm gonna play with some of the FBX export settings to see if I find anything...
They won't match actually. Fixing the rotation is not the same thing as having the same coordinate system. You will have problems when you're dealing which way is the front/back. Right and left will get messed up as well. Applying the rotation doesn't change that. $$anonymous$$ostly for symmetrical objects you won't have problems but when it's not and front and back also matters.
Answer by $$anonymous$$ · Apr 13, 2016 at 11:27 AM
Inside your Assets folder, create a new folder called Editor and paste the code from http://wiki.unity3d.com/index.php/FixBlenderImportRotation into a new C# file. This script fixes the issue of models facing up.
While modelling, ensure the camera front view is facing your model's back view, otherwise your model will be imported facing backwards. Haven't found a proper solution for this.
Before importing, ensure you have applied rotation and scale to prevent scaling issues.
This was always my go to
http://forum.unity3d.com/threads/blender-unity-rotation-fix.181870/
But in latest versions of Blender you can apply the experimental fix and select the axes on export and it comes out right, for me.
Thx @meat5000, the "!EXPERI$$anonymous$$ENTAL! Apply Transform feature of Blender FBX export works for me also, (in v2.77) so long as I have axes set to Z Forward and Y Up... So presumably that means it is converting Blender's axes from Z Up, Y Forward, into Unity's Z Forward Y Up in the baked FBX data. Unity still insists on rotating 180 around Y axis for some reason on asset import, but setting it all back to 0 in the Unity transform rotation brings the object mesh to align with how it appeared in Blender.
This is a life saver. I had been playing with the "Y Up" and "Z Up" Blender FBX export settings but they had no effect in Unity. This is the magic button that turns on those settings! With this checked, the models are imported into Unity exactly as desired, no nasty rotations. Thank you!
Answer by Ogdy · Dec 28, 2019 at 01:40 AM
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)
Answer by sudoku1v2 · Oct 04, 2020 at 09:23 AM
In BLENDER select View with 1 and 9, and this will correspond to Front view of the object on UNITY in 2D. Note also that: length of 1 in BLENDER corresponds to length of 5 in Unity. More simple...