Universal Wheel Physics

We’re finally here! :smile:

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!)

Asset store: Unity Asset Store - The Best Assets for Game Making
WebPlayer demo: CLICK
Have fun, post your opinion or feature request, all feedback is welcome! :wink:

I hope you will upload a webplayer to test it before buy it.

Customer wish is my command;)
WP will be up this weekend at the latest.

Waiting for this !!.

And if i want to make a drift car, can use this to make drift car ? is it optimized for mobile ?

Yes, drifting game should be no problem, also UWP’s performance is mobile-friendly.
I should mention it in main description, thanks for reminder.

Yes, demo will be great :slight_smile:

Web player demo is ready!
Updated first post.

1 Like

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 :slight_smile: ( 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 :wink:

One question, in your wheel physics, do you add Torque for Acceleration and Brake like Wheel Collider or, it can be made in another way?

Hi Roni,
This looks really good! Is the demo car rig included? :smile:

I don’t know if I understood your question, but yes, it uses addTorque on acc/braking for simulating rotational inertia.

Yes, of course :wink:

Hello,

How can I check if the wheel is grounded? Like stock WheelCollider.isGrounded

Thanks

Pretty sure this tools has an equivalent. :wink:

Oh ye? Well what is it then? I bought it and I cannot find the equivalent

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.

1 Like

@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.

Sure. Just limit torque when your target rotational velocity is reached.

Hi @Roni92pl

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 ?

Thanks

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