- Home /
May export: transform at export to Unity facing incorrectly
Hey,
I set the z-axis facing to the front of a model in Maya but at export in Unity Z-axis faces the opposite direction.
Maya before export: Imported into Unity:
Provided Y-axis is also up in Unity, changing z-world axis in Maya for Y does not solve this problem.
Can you please help?
Thank you, Sergio
Answer by Bunny83 · Jan 13, 2018 at 09:47 PM
As you can see when looking close at the handles in maya and in Unity they are not the same. Maya uses a right-handed coordinate system (R-G-B / X-Y-Z --> thumb, index finger, middle finger on the right hand) while Unity uses a left-handed coordinate system (R-G-B / X-Y-Z --> thumb, index finger, middle finger on the left hand). There is no general or unique way to convert between a left handed and a right handed system. You always have to invert at least one axis. In most cases it's the z axis that gets inverted.
If you want to have the z axis pointing "forward" when imported in Unity you probably want the z axis pointing backwards in maya.
Though in most cases you shouldn't really care about how the model got imported. You can simply create a new empty gameobject in Unity and add your model as child object. You can rotate the child by 180° around the y-axis. Now just use the empty gameobject as your root object for your ship. You can create a prefab out of the new root object by dragging it into the project panel.
Answer by Tarrag · Jan 14, 2018 at 05:48 PM
Hey @Bunny83 , thank you for your answer, this now makes sense.
Interestingly I exported the model from maya with the z-axis facing backwards but the model's axis come into Unity still the same, i.e. z-axis facing backwards. Maya allows to to set the y or z axis facing up, but regardless how it's set it always goes into Unity the same, z-axis facing backwards, y-up.
I used parenting for the model but was trying to avoid it particularly if every moving maya-exported object needs parenting. I hear parenting can slow down unity because of cache positions, every time you access anything in transform, it has to calculate the position based on the current location of it’s parent objects (if you are accessing the position of many nested objects this can get quite expensive). Also heard that when you change one of a child transforms, it needs to tell every other object in the tree.
Cheers, Sergio