- Home /
Bounciness 0 still bouncing
I have 2 cubes falling under gravity onto a plane "floor"
The plane has no rigidbody, and when the first cube hits it stops dead, which is what i want.
However, when the second cube lands on top of the first it is bouncing, despite both cubes rigidbodies having a physic material with 0 bounciness.
How can i make the cubes stop dead on collision in all situations?
Has bounciness combine also been set to $$anonymous$$imum?
Same situation unity 2019.3.15f1. I tried one more thing: wrote cpp code using physx 4.1 and saw that there is no bounciness there (used material with restitution 0). If I set restitution to 0.2 I get bounciness that look more like in unity with bounciness 0. So, looks like a bug
Finally managed to stop cubes from bouncing by setting rigidBody.maxDepenetrationVelocity = 1 for both cubes. PS value 1 I got the following way: As I mentioned earlier, I created a c++ project using physx the regular way. I attached a PhysX visual debugger to it and created a pvd capture file (dump). And found $$anonymous$$axDepenetrationVelocity 1 in it
Answer by Deepscorn · Jun 16, 2020 at 04:50 PM
As I wrote in comment http://answers.unity.com/comments/1742680/view.html and as discussed here https://answers.unity.com/questions/217639/physics-objects-passing-through-each-otherbouncing.html It may be an objects penetration problem.
So, to conclude everything in one post:
To disable bouncing you use the PhysicMaterial, set bounciness to 0 and you may need a bounce combine set to minimum.
Further, you may look at setting Bounce Treschold to some high value (Edit -> Project Settings -> Bounce Treschold),
If all of that does not help in your case, set rigidBody.maxDepenetrationVelocity = 1 for cubes
Answer by Statement · Apr 16, 2011 at 12:58 PM
You need your floor collider also have a 0 bounce material. Note that you don't need a rigidbody to set physics material. It is the collider which provide this property.
You are right, i have of course been setting the material on the collider not the rigidbody, and the floor has no rigidbody at all.
Even with all 3 set to the built in metal physicmaterial, or my own nobounce one, the bounce still happens between the 2 cubes, but not the first cube and the floor..
You can check out the physics manager to tweak any other parameters. Note that there is a built in bounce threshold. http://unity3d.com/support/documentation/Components/class-Physics$$anonymous$$anager.html
Thats what is even weirder, setting the bounce threshold to something stupidly high has no effect, the cube still bounces exactly like before.
Having the same problem, seems like a bug in the physics engine. Two colliding objects with 0 bounce threshold should NOT bounce...
Answer by FerventGaming · Feb 25, 2013 at 05:15 AM
I had this issue as well and solved it by removing any positive velocity on every fixed update should there be any. I wrote a short blog post about it here Heavy things should not bounce!
Sorry mate i cant thumbs up because of my reputation, thanks.
Answer by Sacristan · Apr 16, 2011 at 12:17 PM
Well, You could disable physic material if cube collides with Plane or you could manually set bounciness to 0 in script when cube collides with plane...
Bounciness is already set to 0 in the physicmaterial for the cubes, i was under the impression this should be enough to prevent bouncing?
Answer by Jason B · Apr 16, 2011 at 03:22 PM
Turn up how many physics calculations occur. Could be a problem with calculation accuracy (but seems unlikely with only 2 cubes).
Nope! Am starting to think this must be a unity bug? I don't understand what else could be wrong in such a simple scenario.
Unity uses PhysX, so this is either a PhysX bug, or a problem with how Unity is implementing it. I'm actually inclined to think the latter, as this isn't the first time I've experienced some PhysX issues that only occur within the Unity engine. For instance, PhysX inside Unity seems uncharacteristically slow and I don't know why.