Unity Wheel Collider for Motor vehicle
Greetings everyone!
Want to Make a Car Racing Game?
Having troubles with Car Physics?
Where to use Wheel Collider?
How to use Wheel Collider?
What are the components of Wheel Collider?
How is Wheel Collider Different than other Colliders?
Have these Questions in Your Mind?
No worries. You will get a satisfactory answer to all those questions, right here.
GameDev.net: How to Create Homing Missiles in game with Unity
Unity Wheel Collider for Motor vehicle Tutorial 2018
These will give an idea of how to work with wheel collider and physics of Wheel Collider.
Want to Make a Car Racing Game?
Having troubles with Car Physics?
Where to use Wheel Collider?
How to use Wheel Collider?
What are the components of Wheel Collider?
How is Wheel Collider Different than other Colliders?
Have these Questions in Your Mind?
No worries. You will get a satisfactory answer to all those questions, right here.
GameDev.net: How to Create Homing Missiles in game with Unity
Unity Wheel Collider for Motor vehicle Tutorial 2018
These will give an idea of how to work with wheel collider and physics of Wheel Collider.
Comments
I've toyed around with the Unity wheel stuff, and it works okay at moderate speed. Sometimes when I hit terrain at high velocity the wheels fall through the surface and stick to the other side.
Any tips on how to avoid this, or worst case, detect this and recover?
Without looking if the the code provided in the example, I can say that reducing the 'Fixed Timestep' improved this to an acceptable point - using a value of 0.0001 seemed about right for me.
If you need anything faster, you might as well swap out that spinning wheel and replace it with a pre-made spinning wheel animation, when the wheel revolves at speed beyond a certain amount, and keep the collider from rotating, and swap it back in when it slows down, when it as at more acceptable collision detection rates.... if you know what I am getting at..
In the past, I've had some success with making the collision geometry of the world have thickness. I've also tried to raycast when things move (raycast distance dependent on velocity), to check for incoming collisions before they happen and plant my objects where the raycasts hit.
But like you said - make the meshes more pronounced.
I love your idea of raycasting to predict collisions ahead of time! Neat :)
Unity's continuous collision mode works a little better than the default.
Generally most people take one of two approaches 1) a custom wheel collider - not for the feint of heart. Or 2) fudge the unity wheel collider. IRC eddies wheel physics from the asset store takes a similar approach. e.g if your problem is the raycasts penetrating the scenery I'd play with TerrainData.thickness or create some kind of custom suspension script that always makes sure the wheel is pushed above the scenery/collider