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 /
avatar image
0
Question by AntLewis · Sep 06, 2011 at 07:29 PM · rigidbodysleeping

Rigidbody Sleeping

Hi, I've a series of rigidbodies stacked on top each other in a column. When they come to rest on top of each other, I was hoping that they'd go to 'sleep' as they're velocity is less than the sleep velocity. However, according to the documentation if there is a collision with another rigidbody this will automatically wake them up, even if that rigidbody is also stationary. I'm assuming this is happening in my case, as the rigidbodies have a velocity of 0,0,0 yet they won't go to sleep.

Can anyone suggest a way around this? I was initially going to try and remove their rigidbody component at runtime, but this doesn't seem possible. Essentially what I want is the rigidbodies to act under gravity and collide with each other, and then when they have settled, lose their physics behaviour.

Thanks!

Comment
Add comment · Show 5
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 Illogical-Ironic · Sep 06, 2011 at 07:31 PM 0
Share

Not sure if this helps, but have you tried modifying the Drag / Angular Drag?

avatar image AntLewis · Sep 06, 2011 at 07:59 PM 0
Share

I'm not sure how that would help to be honest, I have tried playing around with it but they're all still awake.

avatar image Waz · Sep 06, 2011 at 08:31 PM 0
Share

It would help by burning up some of the energy in your scenario. Even in the real world, a pile of frictionless objects will dance and jiggle around forever... if the real world had frictionless objects.

avatar image AntLewis · Sep 07, 2011 at 07:44 AM 0
Share

Ok I understand. I tried altering this as the game ran but to no effect - is there a specific number angular drag should be at, perhaps relative to the mass of the object? Thanks for the help

avatar image Waz · Sep 07, 2011 at 01:16 PM 0
Share

I don't recall the units, but no, it is independent of mass, as is drag.

4 Replies

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

Answer by Meltdown · Sep 07, 2011 at 07:58 AM

Have you tried tweaking the settings in the Physics Manager ?

You will specifically want to look at tweaking the Sleep Velocity, Sleep Angular Velocity and the Bounce Threshold to get the effect you want.

Comment
Add comment · Show 4 · 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 AntLewis · Sep 07, 2011 at 08:40 AM 0
Share

I have briefly but will look again inmore detail. I guess fundamentally I'd like to be assured, can you have to rigidbodies on top of each other 'sleeping' if all these values are correctly set up? Thanks again

avatar image Meltdown · Sep 07, 2011 at 01:25 PM 0
Share

Yes, that is where the bounce threshold comes in. Set that value to low enough and you'll get the bodies to sleep as you want. If you find you are setting the values too low you might want to increase the scale of your rigidbodies and your scene.

avatar image AntLewis · Sep 07, 2011 at 05:25 PM 0
Share

Ah right apologies, part of my scripts was moving the rigidbody when it shouldn't have been, therefore waking them up! Thanks for all the help

avatar image Meltdown · Sep 07, 2011 at 05:41 PM 0
Share

No worries, please make sure to upvote/mark as answer any answers that helped you.

avatar image
0

Answer by NorthernEagle · Feb 15, 2012 at 02:41 AM

Just ran into the same issue as the original poster. Thanks for the answers!

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 Meltdown · Feb 15, 2012 at 06:52 AM 0
Share

Don't post comments as answers.

avatar image
0

Answer by ElMenduko · Feb 11, 2015 at 05:45 PM

Apart from changing the physics manager option I think you can manually send them to sleep with rigidbody.Sleep

Bad thing is you might (not sure about it) have to wake them up manually with rigidbody.WakeUp

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 Binbag42 · Nov 30, 2016 at 05:00 PM

Why not setting your RigidBody as beeing Kinematic so that it is not affected by collision but will still affect others so that you can stack your other rigidbodies. For information Unity scripting reference is at: link text

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

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

9 People are following this question.

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

Related Questions

Do asleep rigidbodies prevent from modifying its variables in runtime? 1 Answer

Enemy can't trigger a hit when the player doesn't move 0 Answers

All objects sleeping not working 1 Answer

Rigidbody.IsSleeping() VS Rigidbody Velocity Comparison. Performance question for object stop detection. 1 Answer

Limit Rotation of Rigidbody to 45 Degrees (Handlebars on a Bicycle) 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