- Home /
Change rotation axis when importing from Maya
I'm having a problem where, when I import a model from Unity, it appears to transform along the wrong axis. When I opened the mesh in Maya again, i realised it was facing the wrong way, as in the 'front' side was actually the right side of the model. However, even after I group and rotate it, it still faces the wrong way. This is the code I'm using to animate the model:
void Update () {
if (Vector3.Distance(transform.position,target.transform.position) < 10) {
animation.Play("ToySoldierWalk");
leftArm.animation.Play("ToySoldierArmLSwing");
rightArm.animation.Play("ToySoldierArmRSwing");
key.animation.Play("ToySoldierKeyTurn");
transform.LookAt(target);
transform.Translate(Vector3.forward * walkSpeed * Time.deltaTime);
}
The model moves towards the target facing the wrong direction, right side first. I was wondering if there was a way to change the rotation axis or the direction it moves in by the script? I have some experience with Unity but am more used to coding in JavaScript, however I would prefer to do the scripting for this project in C#.
Thanks for any help!
Answer by create3dgames · May 03, 2013 at 11:59 PM
Remember, forward is Z axis in Unity. Just make sure you have it set up that way in Maya, and check your export options.
Thank you for answering, I've tried rotating the model in $$anonymous$$aya though, facing forwards the correct way on the Z axis but when I import it to Unity it still does the same thing, so I was wondering if I could change it through coding in Unity ins$$anonymous$$d.
Answer by paynter3d · May 30, 2014 at 03:48 PM
Did you get this worked out? I am trying to figure out the same thing, exporting rotations from unity to read into maya, but can't figure out how I am supposed to deal with left handed vs right handed z-axis and rotation order
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Rotation conversion from Unity to Maya question 0 Answers
Constraints on rotation axis in c# 1 Answer
Problem fixing quaternions 1 Answer