Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Pixelen · May 03, 2013 at 06:01 PM · c#rotationaxismaya

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!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Pixelen · May 04, 2013 at 01:05 PM 0
Share

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.

avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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

FPS Controller rotate between two points c# 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges