Search Unity

Unity 5. WheelCollider component is unusable.

Discussion in 'Physics' started by SeriouSerg, Mar 4, 2015.

?

What do you think about new WheelCollider component?

Poll closed Apr 3, 2015.
  1. It is unusable and needs reingeenering.

    59 vote(s)
    80.8%
  2. It is suitable for use

    14 vote(s)
    19.2%
  1. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,618
    Profiling when you have a very basic setup is not that useful.

    Throw a bunch more physics work in there, then youll start noticing the performance drops
     
    Jonny-Roy likes this.
  2. Zireael07

    Zireael07

    Joined:
    Apr 27, 2016
    Posts:
    47
    I am making a racing game and I am seeing what Marcos pointed out on sidewalks that barely extrude.

    Is there a way to fix it with U5 wheel collider (and some scripting) or am I doomed to try making my own?
     
  3. Marcos-Schultz

    Marcos-Schultz

    Joined:
    Feb 24, 2014
    Posts:
    290
    Edy, you managed to stabilize this problem?

     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,548
    No, this problem comes from PhysX 3.x Vehicle SDK. Some genius at nVidia thought that applying the suspension forces vertically wrt the rigidbody would be the correct way to go.

    Unity devs are aware of this problem and I expect they will be working together with nVidia devs for finding a solution.
     
    Marcos-Schultz likes this.
  5. Okplayback

    Okplayback

    Joined:
    Aug 29, 2015
    Posts:
    3
    hi all, who met the problem with wheel collider falls throught the road collider? I have this problem, i used road collider as a mesh convex flat, thickness, with different count of polygons and it dimensions and sometimes wheel collider falls down, there is no problem only with primitive collider, for example cube....
     
  6. Marcos-Schultz

    Marcos-Schultz

    Joined:
    Feb 24, 2014
    Posts:
    290
    I've been trying to implement large vehicles, such as the photo below.

    Sem título.png

    It is possible to implement such a giant vehicle and Unity physical works well. But a double wheel is 2.5 meters high, is about 2 meters wide, and it is ridiculous to simulate a wheel of this size with only a distance pointed down ...
    The wheel goes through everything all the time, it's horrible.

    I thought of putting multiple colliders, but it is not possible because the shaft is unique, then the suspension should work alone for 2 wheels.

    After trying to implement more than 20 types of different vehicles in my project, I came to the conclusion that the wheels of Unity serve only to 60% of cases ...

    And all vehicles had problems with low substeps, for example:
    ConfigureVehicleSubsteps (1000.0f, 1, 1);
    This leaves the physics of Unity in sync with the wheels, and avoids some unwanted bugs, but brings a very low rate updates to simulate wheels, being necessary to leave the "Fixed TimeStep" in 0.002f to get a realistic result.

    In addition to the various problems that the wheels have, physical Unity does not help much, by making a simple simulation designed to common games, without simulating air friction and vacuum, and this brings some more undesirable effects such as the car jump to 90 km / h, when in reality, not even 150 km / h the car can get off the ground.

    Among many other problems that can still quote, think it's pretty clear how difficult to make a realistic simulator with the wheels of Unity, mainly because of the bugs reported in previous posts.

    I'm currently creating my own wheel, try to get a more realistic simulation. Even if it is extremely difficult.
     
  7. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    583
    Hi, I have a problem with the jumping wheel collider. I have a tank with 14 wheelcollider and sometimes one of the wheelcolliders shots (after colliding with the terrain some kind of unusual big force moves the wheel to +y direction) my tank from the bottom. If the wheel has a big mass, then it is capable to turn my vehicle. The tank has a mass of 62 000 and a spring of 35000 and the damper is 1500 and a wheel mass is 100. The tank jumps often at driving on the flat terrain, because one of the wheelcollider collides with the terrain in a strange way. It seems to be that I'm applying forces outside of physic update, but dis not found any code outside of the fixed update. I'm also not modifying in code the wheelcolliders position. I did not have such bugs with the predecessor of the NVidia Physic engine.
    However, I still suppose, that I made a mistake in my code, because vehicles with 4/6/8 wheels do not have such problems.

    What I did:

    1. Rising the spring to 100000 nearly eliminates the jumping wheels, but if the wheel jumps, then the vehicle is much more affected, looks very bad.

    2. Lower the mass of the wheel to 1. This simply lower the effect of the jumping, because lower mass cannot influence so much.

    I'm using Unity 5.3.3f.

    I can live with this, but about in 1 year I would like to release my game...
     
  8. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    583
    I found the problem. The track controller changed dynamically the Center of Mass. This caused the jumping behavior. Dammit, cannot complain about the wheel collider. :)
     
  9. Jinppa

    Jinppa

    Joined:
    Apr 11, 2016
    Posts:
    6
    Any idea why that is happening? I have an AI controlled car driving around (using standard asset waypoint system) that brakes when it notices obstacle in front, but if it brakes to a complete stop, it can't start moving forward without "chucking it up in the air" first.
    It seems like it gets stuck on terrain.
     
  10. Zireael07

    Zireael07

    Joined:
    Apr 27, 2016
    Posts:
    47
    When will the issues with Wheel Colliders be fixed? I'm not seeing anything about them in 5.5 beta notes...
     
  11. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,548
    WheelCollider issues come from PhysX Vehicle SDK, not from Unity. The causes are a terrible design and a buggy implementation. I wouldn't expect any significant improvement here unless nVidia decides to drop the current version and implement an actually serious design for their vehicle SDK.
     
  12. Cristineltr

    Cristineltr

    Joined:
    May 15, 2016
    Posts:
    8
  13. Zireael07

    Zireael07

    Joined:
    Apr 27, 2016
    Posts:
    47
  14. Marcos-Schultz

    Marcos-Schultz

    Joined:
    Feb 24, 2014
    Posts:
    290
    Edy, you said that did not solve the problem of this video, and said that it was related to PhysX 3.x



    But did you get any way to stabilize this problem?

    I've tried everything, but I have not been able to stabilize, and it's something that gets in a lot of trouble in some situations.
     
  15. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,548
    @Marcos-Schultz tried many things but I coundn't do anything. This is something deep inside PhysX Vehicle SDK. Release notes for PhysX 3.4 mention something that might be related with this issue, but haven't had a chance of testing it yet.
     
    Marcos-Schultz likes this.