• 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
2
Question by Herman-Tulleken · May 20, 2011 at 09:16 AM · physicspenetration

Why is my stack of cubes vibrating, creeping, and penetrating?

I have a stack of cubes, resting on a horizontal bar. The bar is not kinematic, but constrained along all axis in code, and does not use gravity. The cubes use gravity, and are not kinematic. All objects use box colliders.

When I load the level, the stack of cubes vibrate and penetrate the horizontal bar. If I change the time fixed step from 0.01 to 0.003, they don't penetrate anymore, but they still vibrate, and the whole stack creeps to the left, until eventually some cubes fall off.

alt text

Note, when the level starts, there is a slight space between the cubes. (They were initially stacked tightly, I put in the space to make sure they don't penetrate from the get go.)

All objects have a physics material attached:

  • dynamic friction: 0.2

  • static friction: 0.6

  • bounciness: 0

Size of colliders: 0.83333 x 0.83333 x 1

Mass: 4

I want the stack to just keep still. What do I need to do to get it it stand still?

T$$anonymous$$ngs I have tried:

  • Increasing iteration count

  • Adding drag

  • Making the fixed time step even smaller

  • Increase the static friction (If I make it $$anonymous$$gh enough, the creeping stops, but then the objects look like they are covered with valcro, and their behaviour with other physical objects look totally unnatural.)

Comment
Add comment · Show 4
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 save · May 20, 2011 at 09:19 AM 0
Share

Have you tried giving them a physic material?

avatar image Herman-Tulleken · May 20, 2011 at 09:26 AM 0
Share

Yup, i forgot to add, they all have a physic material. I'll edit my question.

avatar image Statement · May 20, 2011 at 09:41 AM 0
Share

How large are the cubes? 1x1x1? What is the mass of your objects?

avatar image Herman-Tulleken · May 20, 2011 at 09:50 AM 0
Share

Hi Statement, I updated the question.

5 Replies

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

Answer by Herman-Tulleken · May 20, 2011 at 02:59 PM

OK, I figured it out.

The floor is not set to isKinematic. Instead, I constrain all six physics parameters (position and rotation) when the object starts. If I use isKinematic instead of the constraints, there is no s$$anonymous$$vering; no weird behaviour.

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 FullHeartGames · May 12, 2016 at 10:20 AM 0
Share

this worked great fr m thank you!

avatar image OmarVectorX · Dec 28, 2017 at 08:14 AM 0
Share

Thanks mate, I was googling for almost one hour trying to find whats wrong with my simulation, and ended up with ur solution :D

avatar image
1

Answer by Statement · May 20, 2011 at 10:06 AM

T$$anonymous$$s is a far shot, but would it help reducing mass of the objects and making your kinematic floor object a simple static collider?

If you are looking for them to stay still until you interact with them, try setting their rigidbodies to sleeping.

Make sure your Physics Manager has proper sleep thresholds.

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 Herman-Tulleken · May 20, 2011 at 12:54 PM 0
Share

Thanks for all your suggestions!

Making the floor static does help a tiny bit, but does not solve the problem. Changing the mass does affect the "quality" of the vibration, but does not take it away (either making objects lighter or heavier).

I tried making them sleep, but I think they immediately wake up again, so this does not help :(

What are proper sleep thresholds? As a test, I made them huge, without any affect.

avatar image
-1

Answer by pahe · May 20, 2011 at 01:35 PM

Maybe try to put each of the $$anonymous$$gher cubes als c$$anonymous$$ldren of the lower cubes in the $$anonymous$$rarchy:

-root
--lowestcube
---lowcube
----middlecube
-----$$anonymous$$ghestcube
--nextcube

Set the parent on OnCollisionEnter(collider) event with t$$anonymous$$s.transform.parent = collider.transform.

T$$anonymous$$s should stop the s$$anonymous$$vering, though it may not always trigger as far as my experience says.

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 pn99 · Apr 25, 2012 at 10:50 PM

"is Kinematic" fixed it but did it fix the penetration issue?

I have a similar penetration issue, and suspect it should be rather straight forward solution. I believe it has to do with the center of the collider (look at the sample image, you can see the stacked cubes come to rest just at the tiny dot in the center of the table). T$$anonymous$$s is exactly what is happening to my objects, except one single object (a 'bowl' that has similar mesh colliders to the rest of the objects on the table), with difference of a 'character controller' that I believe is making it stop at the surface of the table's box collider.

I've tried fudging the table's box collider setting the y scale to 0 (rendering it effectively flat) and that works nicely to stop the penetration, but unfortunately opens a new issue of allowing a different single object (a sphere) to fall penetrating the table entirely, straight through to the other side (w$$anonymous$$ch it does NOT do if I keep my table box collider set to scale of 1).

I could apply raycasting fix to the single fast moving/dropping sphere object, but all t$$anonymous$$s starts to get very patchy IMHO. I'd rather fix the issue at the root cause if that's even possible in UNITY.

Anyone got any ideas?

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 pahe · Apr 26, 2012 at 08:25 AM

You may try to increase the mass of your object to reduce penetration issues. For my project we had a balloon with very low mass and it could move through everyt$$anonymous$$ng when a force was applied to it. When we increased its mass by factor 10 it was not perfect but at least it stopped moving through every collider.

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.

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

6 People are following this question.

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

Related Questions

Shaking physics body container while preventing penetration 1 Answer

More accurate collision detection 1 Answer

How to make objects non-penetrable, inelastic 0 Answers

Penetration based on shape 0 Answers

Compute Penetration with off-center colliders 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