- Home /
Blender, Unity - axis not right
Hello, there are many similar question like this one, but ive already tryed most of the suggestions and they didnt work.. I think unity takes my scripts as suggestions rather than commands.
I have a mesh in blender, that has forward +X, up -y, right -z. I have played around with rotating the mesh in many different ways, and the same problem always occures when its imported into unity: the mesh rotates fine and ill simply rotate by 90 degrees in the directions i need, but the mesh Collider / rigidbody will always want to be in its side facing the wrong direction..
I found a way to rotate the mesh in such a way that the collider/rigidbody are the same in object view, but when i make prefab of it, and instantiate one of these via code, the mesh is wrong. and transforms.forward points in the direction of the model's left.
I could ofc take into account that the mesh is facing the wrong way etc, and compensate via ninja code, but future meshes might not have the same problem, and then everything will be wrong and much more difficult.
Can anyone please tell me how i should face a mesh in blender, and what to do step by step in unity, to make sure that forward is pointing in the right direction always? Thanks for any help.
Any Future readers, i finally figured out how this works, so i thought i would explain this in a "not so expert" way..
In blender, you make sure that Z is pointing in the direction of the front of your model.. Y is pointing UP, and X is at a side (left or right).. Then Ctrl + A > Rotation, and save it to your Assets in unity..
Once you have done this, add it to your scene, and look at the axis.. in both global and local orientation, you should have Z being the front, Y Up and X being to a side.. if this is true then you have been successful..
(global and local can be found in the top left of unity's Scene view, a small button with the text global or local, clicking the button will switch from global to local coordinates).
Hope this will save someone's time alot, and thanks to the people who took their time to answer my question.
Thanks! Turned object to same axis and everything work nicely :)
Answer by Radivarig · Apr 07, 2014 at 01:08 AM
Have you baked your transform? You can do that by ctrl + A> bake position, rotation, scale. That will tell to whatever reads your model that its default position, rotation and scale are the ones you applied. Press N, in transform panel everything should be (0 ,0, 0).
This is for Blender, Unity is not intended to be a model editor by default. There are also some options for axis orientation when exporting from Blender, on left side. You should start with default after you bake and see if the axis are ok, if not and you notice the symmetry like 180 or 90 degrees then you are on a good way, if the Blender exporter doesn't do the trick you can rotate your model and bake again.
alright.. followup question, (because i love to be sure b4 i mess around with things).. The way my mesh is rotated currently in blender, when i bake it, that will become "default facing" for unity aswell, aka when i port it into unity, the coordinates should be 0,0,0 in the rotation and the axis should be correct? or have i completely misunderstood what your saying? :) sorry for being noob..
http://www.youtube.com/watch?v=z3u$$anonymous$$ojTzVEo
I haven't watched that, but you can. It may be helpful. Add another comment about if it is or not so others who find this topic will know.
Thanks alot, i will try this when i get home from work.. and nope, it was very well explained, and easy (ish) to understand :)
Also thanks for the youtube video, ill definitly look at that also..
Answer by getyour411 · Apr 07, 2014 at 12:50 AM
Export from Blender as FBX; on the FBX exporter you can set the x/y/z but the default values are correct for Unity
so your saying that the settings in the fbx editor are for "what format the reciving end will expect"? Or "what direction the mesh's forward and up is"?
Your answer
![](https://koobas.hobune.stream/wayback/20220613142112im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Weird Blender Mesh collider 1 Answer
Unable to import mesh from blender 1 Answer
Blender 3D Model Mesh Backwards? 1 Answer
Blender import mesh doesn't collide with ray 0 Answers
Proper Physics With Imported FBX Models 0 Answers