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

Things I have tried:

  • Increasing iteration count

  • Adding drag

  • Making the fixed time step even smaller

  • Increase the static friction (If I make it high 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 shivering; 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

This 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!

$$anonymous$$aking 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 higher cubes als children of the lower cubes in the hirarchy:

-root
--lowestcube
---lowcube
----middlecube
-----highestcube
--nextcube

Set the parent on OnCollisionEnter(collider) event with this.transform.parent = collider.transform.

This should stop the shivering, 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). This 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 (which 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 this 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 everything 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.

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

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

Actual collision happens before the visual collision 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