Search Unity

Good values for WheelColliders

Discussion in 'Physics' started by NDSno1, Nov 17, 2016.

  1. NDSno1

    NDSno1

    Joined:
    Dec 20, 2014
    Posts:
    223
    Hi all,
    I've been toying around with wheelcolliders' friction curve for weeks and can't get the right values that feel like an actual car (either too grippy that affect speed or not enough speed that produce lots of wheel spin when launch). Can somebody please come up with an example? Also I would like to have a sample brake torque value. I would like a car that behave like a track car, not arcade drifty type of car.
    My current setup:
    Forward friction: in order
    1.5
    2
    2
    1
    1.5 (after factor in terrain data: 2.2)
    Sideway friction: in order
    1.5
    2
    1.8
    1.5
    1.5 (after factor in terrain data 2.2)
    Rigidbody weight: 1760
    wheelcollider weight: 20 each
    terrain data: dynamic friction and static: 0.7. Average.
    torque at each wheel in first gear when launch (I think this is important as I'm trying to limit wheelspin and have a stable launch): 1200
    Finally, brake torque at each wheel: 2000. I'm not satisfy with this value because it stops the car way to fast, even when it's moving at 170 km/h, it only takes less than 2 seconds (which I don't think is realistic)
    Please help. Thank you very much
     
  2. NDSno1

    NDSno1

    Joined:
    Dec 20, 2014
    Posts:
    223
    Bump. Can somebody help me?
     
  3. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Well... there are no such "good values for WheelColliders".

    Due to the terrible desing of PhysX Vehicles SDK (the underlying code behind the WheelCollider), the behavior of the wheels depend on a variety of factors that are inter-related. You may eventually come to some value set that works correctly. But if you modify almost anything in the vehicle, the wheel behavior may become completely weird, even with the same exact values in the wheel collider. The affecting factors include, but are not limited to, the mass, the position of the center of mass, the number of wheels, and the position of each wheel in the rigidbody.

    True. You may have a working vehicle. Then simply disable one wheel (imagine a puncture or a detached wheel) and then all other wheels may become completely broken and start behaving weirdly without any change in the WheelCollider settings. Same when moving the position of the wheels, modifying the mass or moving the center of mass (think on vehicle cargo), and so on.

    And I'm talking about suspension only. I've been unable to extract any logic out of the friction parameters.

    I can only recommend to adopt any of the vehicle physics kits available at the Asset Store. Find the one that best suits your specific project. It will save you a lot of headaches and frustration. There's no other solution at the Unity or PhysX sides expected in the near future.
     
    Deleted User, ch715t0 and Tunity like this.
  4. NDSno1

    NDSno1

    Joined:
    Dec 20, 2014
    Posts:
    223

    Thank you very much.
    I took a look at your Vehicle Physic pack demo and it worked great. The friction and suspension are very realistic. I'm was going to buy that pack, but in the pack there is no option for manual gear and clutch, so I'm holding it back. Is there a way to implement manual gear shifting into your physic kits? It's the only missing thing that I need.
    Also about your pro vehicle pack, when is it going to be released? I actually wanted to have that for my project, since it has everything I need.
     
  5. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @NDSno1

    In Edy's Vehicle Physics the gearbox may be implemented via add-on script that modifies the vehicle's max speed setting based on the currently engaged gear. The vehicle dynamics are simplified in a way that there are no gears in the underlying design.

    Vehicle Physics Pro already includes full-featured gearbox and clutch components that work just as expected. VPP is already available as Early Access (more information here). The development is completed for the first release. I'm now preparing the example vehicles, scenarios, art, tutorials, scenes, etc. I can't tell when the first release will be available, but a wise guess is 2017 Q1. Feel free to write me to edy@vehiclephysics.com if you have further questions on VPP.
     
  6. Marcos-Schultz

    Marcos-Schultz

    Joined:
    Feb 24, 2014
    Posts:
    381
    NDSno1 likes this.
  7. NDSno1

    NDSno1

    Joined:
    Dec 20, 2014
    Posts:
    223
    Thanks for passing by.

    I gave up on WheelCollider after hours of frustration and developed my own wheel simulation that better fit my intent.
    I used Pacejka94 formula in my tire force calculation, and soon will be updated to Pacejka2006 as the book from Pacejka I ordered just arrived. My suspension system is also different as it does not use "target position" implementation from wheelcollider, but a correct spring + damper behavior, with complication from just normal damper to separate damper force at different spring velocity at compress/rebound phrase. I also made a pseudo-3D wheel to avoid sudden jump when going over sharp bumps, a draw back of wheelcollider being just a raycast. If Unity were to adopt the new wheel sweep from the new PhysX then maybe I would use that for ground detection for my wheel simulation.
    Here is a snippet of how it works in current stage.
     
    driftnumata and Marcos-Schultz like this.
  8. NWHCoding

    NWHCoding

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

    HDProDesignTeam

    Joined:
    Mar 16, 2019
    Posts:
    8
    Hi just take a look this (
    ) and this (
    ) link. This is what you are looking for. I hope it helps...
     
  10. HDProDesignTeam

    HDProDesignTeam

    Joined:
    Mar 16, 2019
    Posts:
    8
    Hey there. Just take a look this, this and this link. You will see what unity wheelcollider can do Do not hasitate to ask.
     
  11. Deleted User

    Deleted User

    Guest

    Wait... Is the internal physics system not worth working on?..
     
  12. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    48
    The answer to that question is quite unclear for now. From what I seen, there is an interest in improving the physics engine for simulation, but it still remains that it was clearly designed for games. While this may not pose an issue for some users, others may find the engine's limitations and the ambiguity of its documentation insufficient for their needs. I would suggest to manually code your own solution or use an existing solution (eg., from the asset store). I still appreciate the 3d visualization features that Unity offers, but right now I don't think it or any game engine for that matter offers physics engines designed for simulation.
     
    Deleted User likes this.