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 /
  • Help Room /
avatar image
0
Question by kmay11005 · Sep 08, 2020 at 05:14 AM · quaternionexplain

Don't understand Quaternion.MoveRotation, RotateTowards, LookRotation

What does Quaternion.MoveRotation, Quaternion.RotateTowards, and Quaternion.LookRotation do? From what I read on the Unity Manual, MoveRotation takes an argument and smoothly changes the objects rotation to that value. RotateTowards does the same thing but I can set where the rotation starts and where it should end, along with how many degrees the object rotates by each time it's called. As for LookRotation, it doesn't actually do anything to an object but returns some kind of value. Is my understanding correct, and can someone explain LookRotation in more detail? Also, what scenarios would I use .RotateTowards and not .MoveRotation since they kind of do the same thing?

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 xxmariofer · Sep 08, 2020 at 08:36 AM

not exactly you are confusing usecases and what it actually does.

  Quaternion.RotateTowards

is similar to Vector3.MoveTowards, if you for example use RotationA is 0,0,0 degrees, target rotationB is 180,0,0, and the step is 1 degree, it will return 1,0,0 just adds "a step" towards the rotation

 RigidBody.MoveRotation

the main difference are that you rotate with the rigidbody, so you rotate using physics, there is "no target" rotation, you only tell the object the rotation in which you rotate and you add forces in that direction

 Quaternion.LookRotation 

this is simplier with an example, imagine you want your objectA to look to objectB, you would use LookRotation, that emthod returns the quaternion of an object "looking" to a second 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 kmay11005 · Sep 08, 2020 at 04:29 PM 0
Share

@xxmariofer Thanks for the explanation, but just for clarity

So, LookRotation takes arguments telling which direction you want it to look toward, and which direction is up, and returns the rotation necessary to get to that direction, or does it return the rotation of the object that would have those directions?

And RotateTowards adds the step argument to the from argument when it is called, and the target distance is just the stopper?

Also, does $$anonymous$$oveRotation add the argument rotation to the current rotation of the object to get a new rotation, or does it rotate the object to the rotation. (if the argument passed is 100,0,0, would 100 be added to the objects x rotation, or would the object rotate to 100,0,0)?

avatar image xxmariofer kmay11005 · Sep 08, 2020 at 09:10 PM 0
Share

returns the rotation of the object that would have those directions. it is basically yes, the target is the "stopper" as it name says is the target rotation, maybe with $$anonymous$$oveTowards that is basically the same you find it easier, if you have the gameobject at a positionA and you want to get it to positionB, calling $$anonymous$$oveTowards (the same rotate towards with directions) will add a step from A to B. the object rotates to 100,0,0 but interpolated with the physics system

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

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

Questions about Rotations in unity 1 Answer

Touch based rotation goes wrong after some rotation applied to model 0 Answers

Combining Rotation = and Rotate() 1 Answer

Change angle of a moving object but maintain direction of movement? 0 Answers

How to limit only one axis rotation? c# 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