- Home /
Physics driven cars without Wheel Colliders. Is it practicable?
Instead of using Wheel Colliders, I'm aiming to use cylindrical mesh colliders as wheels for vehicles.
Initially the obvious solution to me was to attach four rigidbody cylinders to a rigidbody car with configurable joints, with limited upward/downward movement for suspension and free forward/backward rotation for rolling the car along. This worked pretty well until I adjusted the rigidbodys' mass to realistic values, resulting in large forces moving and bending the joints ways I don't want.
Then I tried keeping the wheel from moving and rotating the wrong way by scripting transform limits:
Target.localPosition.x = 0;
Target.localPosition.z = 0;
Target.localRotation.y = 0;
Target.localRotation.z = 0;
But it seems that this prevents proper rotation of the wheels and allows the wheels to exert forces in the direction it would want to move and bend were it not contsrained by script.
I tried searching for similar projects or tutorials and I couldn't find any. Any suggestions?
Thanks!
It's definately possible to make your own "Wheel Colliders", however it's going to be a lot harder than just adding a bunch of rigidbodies as wheels.
Why?
WheelColliders were added to the physics engine in an effort solve the sorts of problems that you are attempting to create for yourself.
yea the issue is your literally reinventing the freaking wheel dude. :P
If you scripted it up what you'd end up with is wheel collider code.
personally I need it for a rc car styled vehicle that has big wheels and can drive upside-down. wheelcolliders don't work here
Answer by fred_gds · Dec 27, 2013 at 04:38 PM
Well my suggestion would be to just don't use any colliders on the wheels at all.
Just calculate the force and collision and so on by yourself using different layers.
Or just get UnityCar it's a great plugin offering a car system without wheel colliders.