Universal Wheel Physics, is raycast-based wheel behaviour solution alternative to standard Unity’s wheel collider(WC). It is more stable, flexible and easier to use. You’re not limited to use it as car’s wheels. It can be almost everything: Plane’s wheels, tank’s wheels, or even you fancy robot that have wheels on its arms, head, use wheels anywhere you need! You’re also not limited to use it rotated towards -Y axis like you are with standard WC. To make it as flexible as possible, it also doesn’t solve steering internally, instead you just rotate your wheel’s transform, so your vehicle’s steering is natural consequence of changing direction of forces, not some fake-internal calculations.
Features:
-raycast-based
-well optimized, fully C# coded
-very similiar to Unity’s inspector/API
-mobile friendly
-flexible: exposed as many options as could,while reamining simplicity of configuration
-automatic handling of visual wheel’s rotation and positioning
-much more reliable and universal than standard Unity’s WC
-mixing of forward/sideway forces
-finally you can have wheels on your vehicle’s roof and sides!
-suspension forces affect other rigidbodies
-simulation of wheel’s rotational inertia(you can adjust cars angle in air by accelerating/braking)
-uses realistic Pacejka’s wheel friction curves(fully adjustable on the fly)
-friction curves updates automatically after every change to their variables
-smoothing of visual wheel movement(no more up and down wheel teleporting on square obstacles!)
So bought it, tried to make a motorcycle, bike falls to the side with 2 wheels. OK, fine tried 4 wheels, wheels are somewhat close together and only 2 visible wheels. Really hard to turn for some reason, and still falls to the side too easily. Could you maybe make a motorcycle example ?
Of course bike will fall on it’s side, it’s not complete vehicle physics solution, its ‘only’ wheel collider ( for 2-wheeler you would need fake gyroscope-like forces, but it should’t be hard, for start I would recommend applying torque force in your bike’s Z axis opposite to leaning ).
Regarding 4-wheeler - did you setup everything as in example scene? If you don’t succeed with example scene, try doing step by step instruction in manual, I explained there how to setup wheels so they will position and rotate properly.
If you will still have problem with visual wheels, send me your project(vehicle on empty scene), and I’ll check what’s the problem.
But it really isn’t anything fancy you just have to set your’s visual wheel transform, so that it’s axis is aligned with X axis, and pivot is in it’s center. Let me know if you succeed with it
Yes, it’s my little oversight - there is “contact” variable, but it’s private. Fix is on way. In the meantime you can fix it by yourself just by changing contact variable to public in UniversalWheel.cs class. It should work exactly like Unity’s isGrounded.
@Roni92pl , is possible to have a “big” torque without having “big” speed?, like a Truck for example, that have big torque to move the high loads and with very low speed.
I can not play webplayer via your website (not problem of using Chrome). Could you upload the latest version of webplayer build into dropbox or something other host, so i can download it ?
Hello, we got some small update! The most important change is that fluent wheel movement system is no beta feature anymore, as it works perfectly now. Changelog:
v1.1:
UniversalWheel class:
-new property: SidewaySlip and ForwardSlip (read only)
-new property: HasContact (read only)
-new function: GetGroundHit
-feature: fluent wheel movement system ‘lag’ fixed
-general little cleanup of code and comments