Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 filler03 · Aug 02, 2011 at 08:38 PM · rotationresetorientation

How to change the way an object is facing when its rotation is 0,0,0?

I have imported a blender model and I need it to be facing a certain way when its rotation is (0,0,0) so its prefab can be used properly in code. I can't simply rotate it and resave the prefab because then the rotation will no longer be 0,0,0. Is there a way to reset this?

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
2
Best Answer

Answer by Bunny83 · Aug 02, 2011 at 09:19 PM

Well that's the reason why i always parent imported models to an empty gameobject. Now you can rotate the model the way you need and you use the empty GO as prefab.

The only other way would be to rotate it the right way in blender. But my method has another advantage: When you have done changes to the imported model-prefab, like adding components, those changes will be lost when you reimport the model. If you create a seperate prefab in Unity and just add the model as child that's no problem. The prefab will even work without the model, the model is just the visual part of your object.

Comment
Add comment · Show 2 · 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 Owen-Reynolds · Aug 02, 2011 at 10:50 PM 1
Share

The one drawback is that the script on the new parent now has to "reach down" into the mesh for some things. For example, animation.Play(... is now the$$anonymous$$odel.animation.Play(..., with the$$anonymous$$odel=transform.Find("myChild$$anonymous$$odel"); in Start.

avatar image Bunny83 · Aug 02, 2011 at 11:26 PM 0
Share

Yep, that's right but it's not that bad thing. You should cache the component reference anyway so it doesn't matter if you use .animation / .GetComponent() or GetComponentInChildren() ;)

avatar image
0

Answer by BerggreenDK · Aug 02, 2011 at 10:42 PM

When exporting from Blender, we use FBX format. In the Export screen, you have several options on what axis to rotate around etc.

We found out that we could rotate 90 deg around x and get same direction as in Unity.

All our FBX files are a "parent" at 0,0,0, but the children are 270 deg x, as the export seems to encapsulate the rotation.

You could also fix this automatically by coding an Import filter for the Editor. Search for AssetsImport.

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 Owen-Reynolds · Aug 02, 2011 at 10:46 PM 0
Share

3DS$$anonymous$$ax has the same issue -- flipping axis on export merely changes the starting Transform.rotation. If you want to really fix it, in Blender go to EDIT mode, select all verts, and rotate (start to rotate then type the angle, to get exactly 90.) The same trick may work with bones.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Vertex World Rotation? 4 Answers

Getting the orientation of Hit triangle? 1 Answer

orienting player in one direction 1 Answer

Rest Rotation Constraint 1 Answer

Simulating different gravity, how to make falling platform fall in the desired direction? 1 Answer


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