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 kushgodofhope · Mar 02, 2014 at 09:42 AM · rotationinstantiatehorizontal

Is there a way to set the current rotation of an object to 0,0,0?

what i mean is, i have an object that when it is 0,0,0 it is at a real screwed up rotation and i want it to be rotated so that it lies horizontal (its a long object). so the rotation values when i can make it horizontal are all screwed up.. x = 34.57777. y = 226.0514 z = 231.7793. this causes problems when i try to instantiate the object because it sets the rotation to 0,0,0 and it doesnt lie horizontal, so i was wondering if i could set the current rotation to equal 0,0,0 when the object lies horizontal? this is my instantiate line if it helps

 Instantiate(thePrefab, leftwallpos, transform.rotation);
Comment
Add comment · Show 1
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 robertbu · Mar 02, 2014 at 12:15 PM 0
Share

$$anonymous$$odeling program is best. I have an editor script that will solve this problem posted for another answer. You rotate your object to how you want it to appear select the object in the hierarchy, and the script will make a clone that has rotation (0,0,0) and scale (1,1,1):

http://answers.unity3d.com/questions/561786/how-to-export-obj-from-editor-with-rescaled-mesh.html

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Invertex · Mar 02, 2014 at 09:56 AM

No, you need to make that change in your 3D modeling application of choice. Rotate the object in it and Freeze it's transforms. What this operation is called, varies from program to program though, that's what it's called in Maya.

Otherwise, look at what the rotation is that looks good for you, and use that rotation value when you instantiate.

edit: Of course, what "whydoidoit" describes is another option, as an empty game object won't create much overhead, though it makes things a tad messier.

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

Answer by whydoidoit · Mar 02, 2014 at 10:08 AM

  1. Make an empty game object.

  2. Add the model as a child of it

  3. Rotate the model until it is correct

  4. Create a prefab out of the parent

Use the prefab instead of the model.

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 whydoidoit · Mar 02, 2014 at 10:55 AM 0
Share

Prefer @Invertex's solution if you have the ability to adjust the model.

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

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

Related Questions

How to instantiate on custom rotation? 1 Answer

Physics related rotation problem. (a weird one) 0 Answers

Shoot an object and have it move based on rotation 1 Answer

Instantiate projectile rotation 2 Answers

Have object face towards player when instantiated 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