Search Unity

Any free WheelCollider alternative ?

Discussion in 'Scripting' started by ZO5KmUG6R, Aug 18, 2014.

  1. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    490
    Hey. I'm fed up of taking shortcuts and adding huge antiroll values to my vehicles with WheelColliders, I've spent probably 12 hours total just editing values of slips, to have my vehicle flip right over.

    Yes, it is the correct scale
    I'm only going 50MPH

    So yeah. Is there anything with some more simpler slip parameters. In Midtown Madness 2 it only had 3 parameters. Once the vehicle reached so much friction the wheels would go to a second set of grip values, It was that simple. No stiffness, no friction curve, nothing.

    So yeah, Does anyone have an alternative that's preferably free?
     
  2. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    vehicle flipping has little to do with slip, and more to do with center of gravity.

    Code (csharp):
    1.  
    2.  
    3. //first try it at zero... generally this should be what you need
    4. rigidbody.centerOfMass = new Vector3(0,0,0);
    5.  
    6. //if its still flipping start moving it down like so
    7. rigidbody.centerOfMass = new Vector3(0,-1,0);
    8.  
    9.  
    watch your car flipping problems disappear... you can be sliding sideways at 200 clicks not flipping if you want.
     
  3. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    490
    The center of gravity is at -1. and the car itself is above the center of gravity. If I put the car at 0,0,0 I flip over at bout 5mph
     
  4. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
  5. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Right... one thing I found out, because I was creating my wheelcolliders at runtime, it was resetting the centerOfMass, so I had code to check it and reset it if wasnt where I expected.

    Am sure you know this though.

    The slip does seem pretty crappy though... I didnt find the help docs particularly useful in helping understand how the values worked.
     
  6. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    490
    I think I may be applying the center of mass then adding WheelColliders. We're using a custom built framework that uses no assets other than scripts, everything is loaded from files. I'll try that once I get back on my main PC.
     
  7. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Yep, I follow the same pattern. The last thing you do should be set center, because every subsequent addition/removal of a collider will cause the rb to re-calculate where it thinks the center is...
     
  8. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
  9. fire7side

    fire7side

    Joined:
    Oct 15, 2012
    Posts:
    1,819
    I guess, since the post prior was for 2014, it is a little bit late now. I think you should find a different way to advertise your product. This is for people having scripting problems.
     
    driftnumata, onestopjs and relsqui like this.