- Home /
Is there any way to improve collision detection accuracy with the mesh collider?
I have a rigidbody set to continous dynamic. I have been playing around for hours, editing the Solver Iteration Count, Min Penetration for Penalty, mass, etc properties in the physics, along with constantly trying different values on my rigidbody and mesh collider wall.
No matter what I do, in certain instances, the rigidbody is going through the wall without colliding. If I reduce the velocity of the rigidbody, the collision is correct, however the velocity I require to simulate real life speed, in certain cases, sends the rigidbody through the wall with no collision. If I add a force of about 500 on my rigidbody, that has a mass of 1, and drag of 1, and angulardrag of 5, it collides fine. If I go over 600, it goes through the wall. Min penetration for penalty I have tried 0.0001, Solver Count even up to 200, no difference.
The only solution I have found is to create a box collider for my wall, then all collisions work perfectly. The problem with this is many parts of my wall are curved, which makes it difficult to accurately place box colliders.
So besides having to painstakingly place box colliders and line them up seamless and perfectly, is there anything else I can try to get my rigidbody colliding better with my mesh collider wall?
It's not hard to make colliders if you use a modeling tool. http://www.unifycommunity.com/wiki/index.php?title=$$anonymous$$esh2Collider
Answer by Paul 7 · Mar 25, 2011 at 07:56 PM
Check this out. It might help.
After extensive testing this seems to be the most feasible solution. Thank you.
Does anyone have the DontGoThroughThings Script, because i think the domain is no longer in use.
Hi. I'm encountering the same issue right now. But my character hadn't collider attach directly to it. It has compound collider attach to different body parts. How can I use this?
Answer by Jason B · Mar 25, 2011 at 08:22 PM
Another thing to try is going into the time settings and setting your fixed update interval to a smaller number. Just don't overdo it, because this alters how many times per second physics are calculated (so for instance, halving it will automatically DOUBLE the workload of physics interactions), but it is an avenue to consider when you have a lot of fast-moving objects that are in danger of going through things.
Aaah not to worry. Even on 0.005 my object is still going through the wall in some places. The DontGoThroughThings script as mentioned above has worked out to be the best solution.
Your answer
Follow this Question
Related Questions
collision between a rigidbody and a mesh collider not working 1 Answer
Unreliable collision detection between rigidbody and mesh collider 1 Answer
Workaround to Non-Convex mesh colliders with non-Kinematic RigidBodies? 1 Answer
Rigidbody objects not colliding. 4 Answers
How to remove internal triangle/faces when combining mesh 0 Answers