Car with Wheel collider flips out at start of scene
I've been looking around Google and here for a while now and I can't find anything describing my problem exactly. I'm pretty new with Unity, but I'm pretty familiar with C#.
I have a simple scene with a racetrack and a race car with 4 wheels (as they tend to have). The race car has a script attached to it that is basically this one. (I just updated some of the variable names to my liking). The car prefab has a rigidbody, and each wheel has a wheel collider. I've set the mass of the car as high as 5000, no difference there.
When I start my scene, the car immediately goes bananas. By which I mean it launches into the air, backwards, at a high rate of speed. The front wheels also come flying off sideways away from the car.
This is a screenshot after less than a second of time passes. You can see the front tires on the ground. The car starts the scene at the first starting position, on the ground.
I've tried disabling the script that's attached to the car. The result of that is that the car just starts flipping over and over, like it's bouncing on the pavement, until at some point it falls through the track into the nothingness below.
Any ideas?
Answer by chrisch · Aug 11, 2017 at 06:47 AM
I fixed it by adding a box collider to my car model. I think it may help you if you are still confused.
I had this problem as well. I originally had a mesh collider on my vehicle, and replacing it with a box collider stopped the instant fly-out.
Answer by johnmachage · Mar 01, 2017 at 10:20 AM
hey i just fixed it make new game objects that are of the required axis positions i.e z facing fowards and place the wheels and body of car in those new game objects.i.e new game object called wheels facing correclty and i parent the wheels in that game object,it worked for me
Your answer
Follow this Question
Related Questions
Why are my wheel colliders making a wheelie? 1 Answer
Ragdoll with Wheel Collider flips wheel collider 0 Answers
WheelCollider: Car on boat. Car is pushing boat. CAUSE: WheelCollider (Suspension?) 0 Answers
How to get a smooth average of wheel collider RPM; 1 Answer
WheelCollider goes crazy at a certain speed, looking for tips on how to diagnose 0 Answers