- Home /
Wheel falling through ground
I have a standalone wheel with a wheel collider w/ the following setup
- Wheel (script here)
- Wheel Mesh GameObject with attached Wheel Collider
My script is very simple:
var Torque : float = 20.0;
var Wheel : WheelCollider;
function Update () { Wheel.motorTorque = Torque * Input.GetAxis("Vertical"); }
When I then move the Vertical Axis, the wheel begins to rotate and then falls through the ground. What am I doing wrong?
make sure rotation is on the Wheel $$anonymous$$esh, not the WheelCollider
Answer by qwertyp · May 24, 2011 at 08:46 PM
I actually didn't end up using a wheel collider. I just used a mesh collider and added torque to the rigid body. Works fine. The wheel collider was really a bit more complex than necessary.
Answer by Muzz5 · May 24, 2011 at 03:21 PM
Use multiple wheel colliders, perhaps? Because they are wafer-thin, not like a 'real' wheel. They fall over so easily if you've only got one of them, to the side, and then would fall through the terrain. If you're making a game with just a wheel, then perhaps try freezing the rotation.
Sorry to gravedig but freezing the rotation solved the problem he described. Thank you $$anonymous$$uzz5
Answer by reptilebeats · Jan 29, 2012 at 02:09 AM
you got them set up the wrong way round either whe wheel collider should be the root or in a seperate folder in the root