- Home /
how to have a correct collision on wheel collider
I was hoping that unity 5 could resolve it but looking at their video it seems not:
as you can see the wheel is intersecting the blue mesh because the wheel collider only raycasts down from the center of the wheel. This is not only a visual problem, but also creates a wrong physics result because the wheel is not pulling up the car at all. The car goes up only because is already moving forward with enough speed. But if you start from zero the car could just get sucked there.
How do you suggest to resolve it? Any trick? Or I have to complete recode the behaviour of the wheel collider with some capsule collider, joints, etc.?
Just an idea... can you not offset the wheel's collider half a wheel ahead of the render?
If I do that the wheel will be pushed up earlier and too much and will float in the air. Also it will be worst when going down from the step. The wheel will move down earlier and will be inside for 2/3
try attaching one more sphere collider to its child gameobject.
I am not sure about this but I think with a wheel collider you can also use capsule collider on the same game object.
Try adding both colliders and modifying the capsule collider to suit your needs.
Red.
Thank for the suggestion. I tried and if I add also a sphere collider, the wheels don't penetrate the object, but the car never climbs the step. It is the same as hitting a wall, also for a small step. Also it breaks completely the suspensions behaviour.
Answer by mcmorry · Apr 08, 2015 at 03:16 PM
A partial solution found was to use more wheel colliders on the same wheel rotated at different angles. It's not the best but with some fine tuning you can get a decent result.
you can not add same thing twice in one object
Answer by chloridrik · Apr 09, 2015 at 04:36 AM
Thank you. Do you know if Edy's vehicle solve this problem ?
we customized edy's code to do this. there are some methods that are called for each wheel collider. we just searched all them and called also for our additional colliders. There is a new version of edy's physics on the asset store but we are still using the previous one. We didn't test yet the new one because is very different and will require new research and tests.
Answer by dewing · Aug 03, 2015 at 04:06 AM
...more wheel colliders on the same wheel rotated at different angles.
Can you give a bit more detail on how you attached/rotated the additional wheel colliders? I'm trying to solve precisely this problem (love the pic you captured above) and it seems when I add another wheel collider rotated 45 deg, it still acts in the "standard" orientation.
On Unity 4 was easy. On Unity 5, ins$$anonymous$$d, you have to place a WheelCollider vertically inside a parent with a rigidbody (probably a kinetimatic one), and rotate the parent of 45 degrees.
Hi, I'm trying to add more than one wheel collider on an object for my game but Unity won't allow this, how did you manage to do this? Eg via script?