• 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
Question by Makenshi · Apr 30, 2011 at 08:10 PM · rotationprefabsstudent

Rotating a Prefab?

hi im trying to rotate a prefab on X 90 but its not doing it ive tried using this

void Start ()
{
    transform.Rotate(90, 0, 0);
}

but its not doing it my object is a piece of tetris looking like this watching it from top

 ___
|   |
|___|

and i want it to look like this

 __
|  |
|  |
|  |
|  |
|  |
|__|

i have also tried modifying the prefab and i can modify scale but not rotation any help plz?

Comment

People who like this

0 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 Makenshi · Apr 30, 2011 at 08:17 PM 0
Share

also the models im using are .fbx from 3dmax

3 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Jesse Anders · Apr 30, 2011 at 08:19 PM

Make sure you understand the difference between a prefab and a game object that's been instantiated (cloned) from that prefab.

With the above code, it's unlikely that you're actually 'rotating a prefab'. If however that script is attached to the prefab, then any game object cloned from the prefab should indeed be rotated 90 degrees as soon as its Start() function runs.

Keep in mind though that Start() only runs once, sometime before Update() is called for the first time. As such, in this case it'd probably make more sense simply to instantiate the game object with the desired orientation (rather than modifying it after the fact in the Start() function).

Comment
cleendert

People who like this

1 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 Makenshi · Apr 30, 2011 at 08:22 PM 0
Share

yeah... the thing is i cant really do that it wont let me modify the rotation of the imported asset :S and i tried using it on the Start Function because i only need it to rotate once in X and then do whatever else it needs to

avatar image

Answer by Makenshi · Apr 30, 2011 at 08:45 PM

seems like initializing the rotation in 0 before implementing it on the Start did the job got no idea why but it worked tyvm for the help anyways

Comment

People who like this

0 Show 0 · 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

Answer by no00ob · Jan 16, 2018 at 06:25 PM

Thx a simple way to add this instead of 100 lines of code like the other ways ive seen, thx once more.

Comment

People who like this

0 Show 0 · 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Instantiated Projectiles doesn't go in correct direction! 1 Answer

Flip over an object (smooth transition) 3 Answers

All terrain trees face the same way? 1 Answer

Instantiating with a chance to be rotated. 1 Answer

Preventing parts of a prefab from rotating w/parent? 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