- Home /
Removing bump when going through two adjacent colliders
Hello,
I'm a newbie in unity, and had only finished the roll-a-ball tutorial a few days ago. To challenge myself, I wanted to expand the game into a 3d platformer-esque game, creating a "level" out of 3d cubes and other objects
However, i noticed that sometimes, when the player ball goes through two perfectly adjacent colliders, a small 'bump' up may still occur.
Several search attempts has shown that this is a pretty common problem regarding ghost vertices, but I've yet to find a single working solution. I don't think a charactercontroller will work for such a physics-reliant minigame, and some other solutions that involve editing "Min penetration for penalty" to 0 no longer work since in unity 5 it has been changed to default contact offset (which has to be strictly positive, apparently).
Some other solutions involve replacing everything with a single solid collider, but as you can see from the screenshot its not really feasible (plus it's not really the most elegant of solutions either)
Alternative solutions and help will be much appreciated, thank you in advance!
There may be hacks that will lessen the problem, but having a single collider is the only 100% for-sure solution. Unfortunately, it's simply a limitation of most real-time physics engines.
Answer by Votbear · Jul 28, 2015 at 03:48 AM
I think I found a pretty acceptable fix! In Unity 5, reducing Min penetration for penalty to 0 in Settings->Physics no longer work since its replacement, Default contact offset has to be strictly positive. It's still possible, however, to use an extremely small number (i used 1e-7) to apparently emulate the same results.
It might not be a perfect solution, but I believe it has mitigated the chances of the problem ocurring significantly
Answer by Topillogical · Aug 29, 2017 at 08:10 PM
I also had this problem, and none of the suggestions worked from here. However, setting collision detection to Discrete (the default) on the player's RigidBody (using a spherical collider) solved this for me. I believe that with Continuous Collision Detection, Unity's secret physics system was registering 2 or more simultaneous collisions, and this was causing my player to get stuck.
Your answer
Follow this Question
Related Questions
Is it possible to tell Unity physics to ignore a collision at collision time? 1 Answer
OnCollisionEnter: collision.gameObject has weird behaviour 0 Answers
Excluding some physics collisions 3 Answers
Detecting When Intersection Penalty is Being Applied 2 Answers
Do you have to have a rigidbody component for collision detection? 1 Answer