- Home /
Box collider doing weird stuff in collision with mesh collider
I have seen this a lot around this place, but no one was having the same issue as me. And it's driving me crazy.
I imported an FBX model from Blender into Unity, but every time my vehicle (box collider) "collides" with a slope (tries to go up), it does a somersault and often ends up flipped upside-down. That looks pretty cool, but I don't need it and I can't seem to fix it.
I tried subdiving the mesh, but that only reduces the probability of my box collider doing weird stuff. Sooner or later, it decides to do a somersault. This doesn't happen with Unity's terrain, but I really need to use Blender as it gives me more control. This only happens on slopes; flat ground works perfect though.
I'm guessing this happens because the collider is too .... blocky. Is there a possibility for you to use capsule colliders on the front or even better use a charater controller?
Now that you mention it, I used a capsule collider on the same vehicle, and it does that awesome-but-annoying somersault in place, as soon as I try to move. Just like a rocking chair, it rolls but doesn't move.
$$anonymous$$aybe the problem is in the script that controls the rigidbody?
PS: I can't use a character controller because it's a vehicle (larger than taller) and I need it to be controlled by a rigidbody.
Did you make sure that the colliders attached to your vehicle don't collide with each other?
Btw. If you're making a vehicle you should take a look at this demo projects if you didn't already: http://u3d.as/content/unity-technologies/car-tutorial/1qU
I think just a box collider for a vehicle cause this kind of problems because when i made a test vehicle for my multiplayer-FPS and used just a Box collider it also flipped around when i hit a slope. You could either redo the colliders on your vehicle for example with capsule colliders on the front or like the Car Tutorial Demo Project....Or you could try to replace the mesh collider on the slope with primitive colliders.