Hi all! We’ve stumbled upon a problem and spent a lot of time on it already, couldn’t find a solution yet.
There’s an endless generated track (random sinusoidal thing) and a car that drives on it. Car needs a sort of collision to drive on, so we have created a mesh collider that represented the generated mesh perfectly. BUT resetting the whole mesh collider after regenerating a portion of a track takes as much as 2-3 ms on mobiles, so we have decided to replace one mesh collider with a set of continuously connected box colliders that match up the track quad as is. The wheel collider works perfectly, but sliding on a car’s bumper, or sometimes grounding in it, makes it stumble and bounce a lot (which is interesting because bounciness is set to 0 and calculation is set to minimum)
I’ve tried replacing box colliders with capsule colliders (so they connect with their cylinders), but it didn’t help.
Is there any magic button or a magic tick to enable?
When you get a collision with a collider, the physics engine will move the Rigidbody to the closest point outside the collider which may be inside the next collider in which it will do the same. It probably happens when you get a collision near where they meet.
That’s a nice insight regarding the problem. Do you know any way around it other than using a continuous mesh collider?
Some people have tried putting little colliders just under the surface where the joins are but you may still end up with a similar issue. Like most things it just depends on the specifics.
BoogieD, thanks for the insights.
Interesting solution, tried that, but didn’t work for us…
I have decided to use a small portion of a the whole mesh under the car as a collider (8 quads of mesh). The mesh “slides” under the car constantly, providing a consistent 0.3 ms of delay (on a mid-end mobile device) every frame. 0.3 ms of delay is acceptable for us. The car also doesn’t bounce anymore.