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 rsud · Mar 15, 2015 at 07:46 PM · meshorientationinitial

reorienting a mesh from 3d max in unity?

I've imported a mesh (3d studio max file) into Unity by drag and drop into the project window.

when I instantiate it in my c# code, it is oriented in the wrong way for my use (unity trasform.forward is not forward for the mesh).

So I put the mesh into a gameobject in the project window and reoriented it so its facing the correct way. But when I instantiate it in my c# code it still is oriented the original way (and not the way I oriented it in the project/inspector window). I don't want to reorient it in my code after instantiate it,

I'd like to reorient it in the inspector so when I instantiate it is facing the correct way (the orientation I want).

How can I do this to the mesh in the project window?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Cherno · Mar 15, 2015 at 08:03 PM

I don't think it's possible. Normally, you would rotate the pivot inside Max (in Max, to conform with Unity's axis system, the green arrow has to point upwards and the blue one to the front).

Comment
Add comment · Show 5 · 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 rsud · Mar 15, 2015 at 08:21 PM 0
Share

If I put the mesh into a gameobject in the project window and then I orient the gameobject to face the way I want. Is it possible to preserve the gameobject's (in the project window) orientation when I instantiate it?

avatar image Cherno · Mar 15, 2015 at 08:26 PM 0
Share

That doesn't make sense because if you rotate a game object, you also rotate the axis.

avatar image rsud · Mar 16, 2015 at 01:22 AM 0
Share

$$anonymous$$aybe what I am asking is not clear....

If I put the mesh into a gameobject in the project window and then I orient the gameobject to face the way I want. Is it possible to preserve the gameobject's (in the project window) orientation when I instantiate it?

Currently, if I do the rotation in the project/inspector when I instantiate the gameobject orientation is 0,0,0 (and not 270,180,0 as I set it in the inspector).

avatar image Cherno · Mar 16, 2015 at 02:09 AM 0
Share

Well, the Instantiate function accepts a Quaternion parameter to set the rotation of a newly instantiated object. If you pass it the transform.rotation of the prefab object, it should use those values. However, I don't see how this is related to the problem you stated in your original question about "unity trasform.forward is not forward for the mesh", as this is related to the pivot orientation relative to the mesh itself, and can not be changed in Unity.

avatar image rsud · Mar 16, 2015 at 08:51 PM 0
Share

How can I get (read) the transform.rotation of the prefab object?

I will be putting the mesh (or GO->mesh) inside another GO whose .forward will be used to move the object. The idea is that the mesh (or GO->mesh) can spin freely inside the parent GO so the parent GO can be moving (.forward) while the inserted mesh can point (its .forward) in another direction.

So at load I can keep track of the displacement between the mesh.forward and GO.forward and adjust. But I want to load that displacement by reorienting the mesh in the project panel. I have many objects to load and they all have their .forward displaced from Unity's .forward. SO easier to do it in the project panel than to have to write code to keep track of what GO did I just load and what its displacement is. Hope this was somewhat clear :-)...

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

21 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to rotate and re size an imported mesh ? 0 Answers

I imported a character from blender into unity but the mesh of that character is horizontal? 2 Answers

how to make an horizontal mesh? c# 0 Answers

unity vertex order 1 Answer

Create a mesh of earth 0 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