Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[WIP] Universal Wheel Physics

Discussion in 'Works In Progress - Archive' started by Roni92pl, Jul 9, 2015.

  1. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Hello everyone!
    When I saw amount of posts(problems) in different threads about Unity's wheelCollider, knowing that Unity can't do much about it, I decided to start working on my own wheel physics, that would be much more universal, easier to use, setup and more reliable. Result of my recent work on this project exceeded my expectations, and I willingly share with you a little more details and general work progress.
    I will be very pleased if you would like to share your expectations(also concerning price), and what features you would like to see, so all feedback is welcome. Some more media will come soon(tm : )

    General description:
    -raycast-based
    -well optimized, fully C# coded
    -very similiar to Unity's inspector/API
    -flexible: exposed as many options as could, while reamining simplicity of configuration
    -developed with maximum easy of use and configuration in mind
    -automatic handling of visual wheel's rotation and positioning
    -much more reliable and universal than standard Unity's WC
    -finally you can have wheels on your vehicle's roof and sides!

    Features:
    -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)
    -user-friendly api
    -manual/documentation
    -BETA FEATURE smoothing of visual wheel movement(no more up and down wheel teleporting on square obstacles!)

    Plans/Wishlist*:
    -realistic rolling resistance
    -hard suspension stopping at maximum compression
    -simulation of suspension expansion when no in contact based on spring/damper ratio
    -friction system working with other rigidbodies

    almost done/done

    more than half done
    less than half done

    not started/very early stage

    *no promises for any of these features!
     
    Last edited: Jul 23, 2015
    emergki likes this.
  2. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396

    Small teaser ;)
     
  3. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    Awesome, I'll definitely keep an eye on this. Please do a video showing vehicles of various weights and friction values driving around when it's all working.
     
  4. bawenang

    bawenang

    Joined:
    Aug 18, 2012
    Posts:
    119
    What about the performance?
     
  5. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Little heavier than standard Unity's WC, but I can guarantee it is sufficient to mobile use.
     
  6. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Hello, just coming by to say that I submitted my asset to asset store and wait for review. In the meantime I can show little video presentation showing one feature.
     
  7. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    Looks like a good start. Can we see the car take that jump at the end so we know the wheels aren't just raycasted to always touch the ground?
     
  8. Vossyy

    Vossyy

    Joined:
    Jul 15, 2015
    Posts:
    11
    Hey im interested in this. Can you provide more info on how it works( how does it find contact points, raycast, spherecast etc), is it compatible for 2 wheeled vehicles and provide a video showing different wheel friction settings? Thank you.
     
  9. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Hi, and thanks for interest! I would really like to provide some more media/wider description about how everything works, but unfortunately I don't have time for this, as I have full time job and I create unity assets in my "free time" :)
    However I'll try to answer your all question as best as I can.
    So, regarding first question: it is typical, raycast-based system(as you can see in first post) that raycast in negative Y axis of your wheel's transform. As for two-wheeled vehicles - to be honest I never done that test, but absolutely should be feasible, of course if you develop some mechanism that will keep your bike from falling on it's sides ;).
    As for friction settings and heavy vehicles: everything is stable as long as you keep values in reasonable range.
    Anyway, I managed to have 40 000kgs heavy car behaving like glued to road with no big issues, I think its not possible with current Unity's wheel collider.
    Maybe I will post presentation of some extreme setups soon... maybe in weekend, but no promises! ^^
     
  10. KhaledM

    KhaledM

    Joined:
    Sep 29, 2013
    Posts:
    41
    Hello, Any updates on this project?
     
  11. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Yes, unfortunately it was declined, so we'll have to wait a little longer for a premiere. Im doing my best to re-submit it as soon as possible. Sorry for delay.
    edit: also updated first page with current project progress.
     
    Last edited: Jul 24, 2015
  12. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396