• 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 mazin0 · Jul 16, 2015 at 12:19 PM · rigidbodyangularvelocity

minimum angular velocity?

Hi, I was trying to get an object to rotate in a random direction very very slowly. But I found that there seems to be a limit to how slow it can rotate because when i tried to get it to rotate at less than .02 units it seems to start rotating and stops. I have no angular drag on my rigidbody or gravity. T$$anonymous$$s is my code:

 float tumble=.01f;
 
 void Start ()
 {
     GetComponent<Rigidbody>().angularVelocity = Random.insideUnitSphere * tumble; 
 }


Is there any way to get an object to rotate at a given speed without angularVelocity?

Comment
Bunny83

People who like this

1 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 michaelb212 · Jul 16, 2015 at 12:41 PM 0
Share

I cant really open up unity right now and recreate your problem but if i were you i would focus on what i did wrong rather then ways to bypass this issue, since it seems weird that a widespread commercial well tested physics engine will have such precision problems.

have you tried logging the current angular speed in each frame in the Update() function ?

does it drop in a linear pattern ? at once ? at random ? if you use higher speed does it persist ?

I would test all these things in a brand new project

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Bunny83 · Jul 16, 2015 at 01:04 PM

Well, you are close to the default "Sleep Threshold" of "0.005". I'm not sure if it's translated 1:1 from angularVelocity but if it is it would mean when your "random point" has a radius less than 0.5 it will fall asleep since it moves too slow and is considered to not move at all.

For the physics system it's important to have such a threshold to ignore t$$anonymous$$ngs ( Rigidbodies ) that do not move at the moment. If you set t$$anonymous$$s threshold to 0.0, no Rigidbody will ever fall asleep. Depending on the amount of physics objects in your scene t$$anonymous$$s might have a heavy impact on performance. You shouldn't lower the global Physics.sleepThreshold (w$$anonymous$$ch can be set in the project settings). Instead you can try to set Rigidbody.sleepThreshold to 0 (since you want an eternal motion for that object).

However keep in mind if objects can collide with that RB, it might loose energy. As alternative you can try setting angularVelocity each FixedUpdate to a constant value, or use Rigidbody.MoveRotation in FixedUpdate to rotate it "manually".

Comment
michaelb212

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 mazin0 · Jul 17, 2015 at 04:02 AM 0
Share

Ah, thanks a lot for clarifying that for me.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

AddRelativeTorque results in incorrect angular acceleration (Maybe centrifugal force affects) 0 Answers

Stop velocity on rotation change 2 Answers

rigidbody has a max rotation velocity ? 1 Answer

=> Rigidbody falling too slowly! <= 0 Answers

Transferring velocity from kinematic to a rigid body 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