- Home /
Quick question about wheel colliders
On my vehicle, I have four wheel colliders. I want to be able to delete the colliders on the right side of the vehicle, and still have to vehicle drag itself around on the remaining wheels. However, the vehicle does not move at all if the main body is touching the ground. Any ideas on how to fix this? (I am still setting the right torque and everything for the remaining wheels.
Answer by fred_gds · Aug 21, 2013 at 10:45 PM
Well I am wondering if your wheels are still touching the ground as it seems to me as they might have flipped with car so if you have mesh colliders on the wheel tires the wheel collider might not touch the ground anymore.
If that's not the case i'd guess that in your case the Force of friction is bigger then the force your wheels are applying. Just as in real life. If your car looses two wheels it won't drive anymore.
I see two ways how you could approach your problem. So first would be the make a script which will prevent your car body to touch the ground. But I'm not sure how to approach it. Maybe smth like this:
function OnCollisionEnter() { mainBody.transform.position.y = ground.position.y + 0.0001; }
or smth like this to prevent them from colliding
function Upate() { if(mainBody.transform.position.y < ground.position.y + 0.0001) { mainBody.transform.position.y = ground.position.y + 0.0001;} }
or the other way you could do it which might work is that when you delete the two wheels, you create small wheels which will just fit under the right side of the body so that they prevent the car from touching th ground. I think that this might be the best way to keep the car behavior realistic as you are able to modify the friction and/or brake torque of these "new" wheel(s) to make the car pull to the right side (You can do this too with the first option but I think, that that will be more complicated ).
Your answer
Follow this Question
Related Questions
Friction Issue with Multiple Colliders Touching 0 Answers
Why vehicle decelerate on steerAngle 0 Answers
How to apply frictional Torque 2 Answers
Fast motion of vehicle 0 Answers