Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 creative72 · Aug 05, 2011 at 12:42 AM · rotationlocalgloballocalization

rotate 90% in local space

ok so i have a cube and it responds to the directional keys. whichever key is pressed it needs to add 90 degrees to its rotation in that direction.

(i can do it just fine with Transform.rotate except if the cube is facing down and i rotate to the left instead it rotates the object along what is now the objects z axis)

how do i rotate the object in increments of 90 degrees relative to the objects up down left right ( v.s global directions)?

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 BerggreenDK · Aug 05, 2011 at 01:02 AM 0
Share

do you mean 90 procent(%) or 90 degrees?

4 Replies

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

Answer by creative72 · Aug 05, 2011 at 04:04 AM

answer : Transform.TransformDirection converts local to world space keeping relative left right up down

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
-1

Answer by creative72 · Aug 05, 2011 at 01:16 AM

i meant degrees not quite sure why i put %

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 Bunny83 · Aug 05, 2011 at 01:22 AM 0
Share

BerggreenD$$anonymous$$ added a comment to your question, why do you reply with an answer? Answers have only one usage: answer the question.

avatar image creative72 · Aug 05, 2011 at 01:28 AM 0
Share

im unfamiliar with Unity's answers and wasn't aware there was a comment box. does it really matter that i call a comment an answer anyway when you have the same exact result which is passing an explanation. in fact that comment was an answer to your question

avatar image
0

Answer by kiki.du · Aug 05, 2011 at 01:18 AM

it is not way to rotate the object in the same place. but u can mark down the number on the inspector window. i mean the x,y,z number. then change to play with the number would be one of the easy way to do that.

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
0

Answer by Bunny83 · Aug 05, 2011 at 01:26 AM

Transform.Rotate has another parameter that specifies the Space in which it should rotate the object. The default is Space.Self which is already local space. Maybe you want to rotate it in world space?

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 creative72 · Aug 05, 2011 at 01:34 AM 0
Share

yes that would work except for i need an instantaneous exact rotation of 90 degrees where one frame the object is 0 and the next its 90. not over time

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

6 People are following this question.

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

Related Questions

Rotating Player Controller locally or globally. 0 Answers

Local Look Rotation 0 Answers

How to open and close a door parented to a rotating object? 0 Answers

Local Rotation and then Global Rotation 1 Answer

How can I rotate one axis locally, and another globally? 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