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 /
  • Help Room /
avatar image
0
Question by chelder · May 05, 2016 at 05:58 PM · movementapirotatearounddocumentationrotatearoundpivot

What the angle argument means in the Transform.RotateAround function?

The declaration of the RotateAround function is:

 public void RotateAround(Vector3 point, Vector3 axis, float angle);

Let's say we have a GameObjectA in the position A with the above script attached, and another GameObjectB in the position B:

 float speed = 10f;

 void Update () {         
     transform.RotateAround (B, Vector3.up, speed * Time.deltaTime);
 }

So if I understood well, the GameObjectA will rotate around the GameObjectB. The GameObjectA will pass by its original position once per loop. The rotation will be around the Vector.up axis. The rotation will be at the speed 10. However the declaration of the argument says that argument is to enter the angle, not the speed. Is it a mistake? Am I confused with something about maths or English?


UPDATE: I have drawn a picture that should help you a lot to understand how RotateAround work. See here the picture: http://answers.unity3d.com/answers/1200748/view.html


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

Answer by Jessespike · May 05, 2016 at 06:12 PM

In the snippet, the amount to rotate (angle) is controlled by time * speed per frame. I think you may be overthinking it. It's just using time as the amount to rotate per frame. speed * time is the angle for that frame.

Comment
Add comment · Show 3 · 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 chelder · May 05, 2016 at 06:19 PM 0
Share

So the documentation is simply wrong?

avatar image Bunny83 chelder · Jun 11, 2016 at 02:06 AM 1
Share

Huh? No the documentation of RotateAround is perfectly fine. It's just your understanding that seems to be twisted in a weird way. RotateAround performs a single relative rotation by the amount specified in the last parameter. So if you pass "45" degrees and call the method one time the object will advance on the circle by 45°. Things like speed doesn't have anything to do with that method definition.

If you use that method every frame to perform a continous rotation then you introduce speed in the sense of how much you move per frame or per second( if you multiply by Time.deltaTime). It seems you have trouble understanding Time.deltaTime so you might want read up on deltaTime and try to understand how and why it works. You also might want to read my answer on your linked question carefully.

avatar image chelder Bunny83 · Jun 11, 2016 at 11:54 AM 0
Share

I finally got it. Thank you. Anyway, I think your explanations and my picture should help other people too :)

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

61 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

Related Questions

How do I rotate an object around around another, following mouse position and facing it? 0 Answers

Manual RotateAround 0 Answers

Is there a RotateAround functionality for Rigidbody 2D's? 1 Answer

How to Transform.Rotate Around with the rotation of the controller right stick 0 Answers

Deformation of child object when rotating around a rotatable parent object 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