- Home /
Collision interpenetrating between 2 meshes
I've been kinda ignoring this problem but now I really need to fix it and can't seem to find the solution anywhere.
I have 2 meshes, both using box colliders and the top one using gravity and no idea why, they always interpenetrate slightly when the simulation starts. I even tried increasing the box size and it kind of helps but it causes other issues with shadows etc.
I'm pretty sure there must be a way for the collision detection to be more precise? Could it be a scale issue?
Does your table have a rigidbody, and if so, is it intended to move at all during your scene?
Generally, 1unit = 1meter, but if you're working with tiny objects, it's best to scale up (objects and gravity!). Physics does optimizations that tend to mess with them.
Take a look at the Physics $$anonymous$$anager and the "$$anonymous$$in Penetration For Penalty" setting. Edit/Project Settings/Physics. Quoting from the reference:
How deep in meters are two objects allowed to penetrate before the collision solver pushes them apart. A higher value will make objects penetrate more but reduces jitter.
The table is not supposed to move (and it doesn't have a rigid body attached, just a box collider.)
The scale of the game is currently matching the world scale 1 : 1 and for the Physics I remember playing with it and current its set to a very low value of 0.005.
Why the suggestion for rigidbody? Would it make a difference? Anything else I could try to fix it? Scaling the world up doesnt sound very good since Im using lightmapping and skeletal animations and they both need proper world scale.
Answer by castor · Mar 22, 2013 at 07:49 PM
Just went extreme and set the "Min Penetration For Penalty" to 0.001 and seems to have worked. Hope there are no issues for the value being so low....
Your answer
Follow this Question
Related Questions
Colliders won't work 0 Answers
Box mechanic: Is it possible to know when the box is closed on all margins? 1 Answer
Speed/trigger only working once 0 Answers
Multiple Stacked Colliders only register for single object 0 Answers
Add Health on Pickup to Decaying Health,Make a collision with an object add health 2 Answers