3
\$\begingroup\$

I have created simple project with 3D car and terrain. I have added 4 Wheel Colliders on model wheels. But when I run project wheels falling through terrain.

Before run: enter image description here

After run: enter image description here

I am sure that at start wheel colliders above the terrain and not intersect it. Configuration is: enter image description here

In what problem is? I have tried a lot of different things but I can't find a solution.

\$\endgroup\$
  • \$\begingroup\$ Have you tried starting with the car levitating above the ground? For performance purpose it's possible that the collisions are not computed on first frame, and that could be why your car is in the ground. (I don't write this as an answer as I'm not 100% sure that will help you, but tell me if it helps). \$\endgroup\$ – lvictorino Sep 30 '14 at 10:30
  • \$\begingroup\$ Yes, I have tried that, but situation is the same. \$\endgroup\$ – Dmytro Zarezenko Sep 30 '14 at 10:34
  • \$\begingroup\$ Ho.. hum.. in your post you don't mention Rigidbody... On which part your rigidbody is located? \$\endgroup\$ – lvictorino Sep 30 '14 at 10:36
  • \$\begingroup\$ On Car top object. \$\endgroup\$ – Dmytro Zarezenko Sep 30 '14 at 11:19
  • \$\begingroup\$ Could this possibly be your problem? Your car doesnt seem to fall through.I have no experience with wheels, but many libraries I know usually only care for there task, thus a WheelCollider might tell you that you collided, but will do nothing to solve it? Better ckeck the Documentation... \$\endgroup\$ – J_F_B_M Oct 1 '14 at 8:15
3
\$\begingroup\$

Do "not rotate" the WheelCollider components. WheelColliders are implemented as ray casted down, you can see the direction of the ray on selecting the same in the editor. To get more accuracy try tweaking Physics.minPenetrationForPenalty and Time.fixedTimeStep.

Edit: Noticed the rotation in your inspector window.

\$\endgroup\$
0
\$\begingroup\$

I had a similar issue, on a model imported from Blender. Blender uses a different axis than Unity, so the imported model had an x-rotation of -90 degrees and the wheel collider ray-casts forwards, instead of downwards.

To fix it, in Blender:

In object mode, set the X rotation of your model to -90. Press Ctrl + A and apply rotation, X rotation appears to be 0 now in Blender, set it to 90 and save/export it. You'll see that it will appear both correct and at 0 rotations now.
- Unity Answers: Rotation when importing from Blender

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.