- Home /
Strange FBX import issue; Up Axis
I have a little problem importing a character I did in Max. I am exporting as FBX and on import he always lies flat on his face, instead of standing, no matter if I choose Z-up or Y-up. I tried multiple FBX Formate (2006,2011, 2012), all show the same behavior.
Edit: Also the pivot is at the wrong location (center of the character, not at his feet).
Answer by msknapp · Sep 23, 2011 at 11:12 PM
I had a similar issue, my co-worker did something to try and fix that problem and it worked half the time. For being sideways, I had to keep doing this:
GameObject g = (GameObject)GameObject.Instantiate(prefab,someVector3Position,prefab.transform.quaternion);
This tells it to copy the quaternion from the prefab onto your instance.
For being at the wrong pivot point, you could write a script that finds the minimum y value of the mesh vertices, and then defines a new vertices array by adding a constant value to each vertex y value. You can get the mesh using:
MeshFilter mf = (MeshFilter)obj.GetComponent<MeshFilter>();
Mesh m = mf.sharedMesh;
Vector3[] newVertices = new Vector3[m.vertices.length()];
// insert script to shift all the vertices.
m.vertices = newVertices;