Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

    afftar

    Joined:
    Apr 18, 2014
    Posts:
    54
    It looks like a primitive bug. I was very disappointed in the new unity :'(
    http://take.ms/ZVp4a
    Bugs in the new WheelCollider look so that the wheel after corrects position RigidBody - also change its position=/
     
    Last edited: Mar 29, 2015
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Did you try to increase the spring force?
     
  3. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    226
    I got working 40 000kgs car in like 3 minutes... So sorry guys, but i won't waste anymore time to investigate this topic, because it looks like ppl here just can't do basic configuring/tweaking of wheel collider, that works really well if configured correctly. Yes, there are some setups that won't work correctly and car will 'explode' or jitter, but that means you configured something very wrong, because EVEN if it would work with this setup, it would behave like sh*t....
     
  4. afftar

    afftar

    Joined:
    Apr 18, 2014
    Posts:
    54
    It's not about how to hide the bug. The system produces more energy than it consumes. This is seen in the video. Yes, some of the settings WheelCollider can hide it, but it's a hoax. WheelCollider became a perpetual motion machine in the new version:D This is a basic error in the physical modeling, I will not use this S*** in their projects. I will write itself if Unity can not = \
     
  5. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @skirtz1: "please tell me why the new wheel collider does not support scaling & rotation"

    PhysX does not directly support scaling and rotation on wheels or vehicles. While scaling is fairly easy to implement in Unity integration code, supporting rotations required some deep patching of PhysX Vehicles.

    Though I had to kick scaling and rotation support out of the initial 5.0, I hope scaling returns early 5.x and then rotations will follow on.
     
  6. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @Nition "This was already the case to some extent in Unity 4, right? Just because I found that wheel collider behaviour changes depending on the order of setting rigidbody centre of mass and mass."

    Yes, this is because setting custom centre of mass marks the body as having a custom inertia set. Thus it won't get updated after you set a different mass value. I think there was a bug filed on that. The way I think to address it is to remove this logic and recompute inertia tensor automatically to reflect the newly set centre of mass.
     
  7. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @redthrawn I'm afraid I don't have recommendations yet. Are you concerned about heavier vehicles being as easy to drive as lighter ones? I guess it would help if I post something about friction settings on WheelCollider? (Likely, this won't be helpful for Edy's packages users as Edy uses his own friction code -- @Edy correct me if I'm wrong)
     
  8. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @afftar I think the explanation for the wheels move-and-push behaviour you noticed is present in my post here in the thread as well as in the one sheet WC overview that was posted on twitter. Did you care you read it through?

    As for the initial issue, where the car would lean left or right if the suspension is super long, I have to check that, but it might be a precision problem. Have you tried tweaking substepping? How about simulation frequency?

    After all you have to admit that the configuration you provided is quite weird.
     
  9. afftar

    afftar

    Joined:
    Apr 18, 2014
    Posts:
    54
    Отвечу на родном для нас языке, может так будет понятнее. Я взял вашу сцену как она была, не модифицируя кода и ничего в ней не меняя - увеличил длину пружины и как результат вылез баг(середина видео) с тем, что пружина двигает саму себя и автомобиль. Это означает,что вся эта система не поддается принципу сохранения энергии и вырабатывает ее больше чем потребляет. Я предполагаю, что ошибка кроется где-то в месте изменения transform предка, из-за специфики unity когда вы пружиной воздействуете на своего parent - вы двигаете не только его,но и сам wheelcollider вместе с колесом и пружиной, на следующем тике пружина еще больше распрямляется и еще толкает своего родителя, который опять поднимает и себя и все колесо и т.д. Не проблема что у меня машина завалилась на бок - проблема в том, что после падения она начинает двигаться за счет сжатия и растяжения пружины - утверждать,что проблема решиться если я сделаю ее более жесткой - это просто издевательство! Вы просто пытаетесь скрыть ошибку, эта система должна адекватно работать с точки зрения физики при любых параметрах.
    Эту проблему я наблюдаю у себя в проекте, где при достаточно жестких и коротких подвесках наблюдается дерганье и неадекватные отскоки. Меня очень сильно огорчает подобная лежащая на поверхности недоработка в одном из широко используемых компонентов, это наводит на мысли о том, что если капать двигатель глубже подобного вылезет еще не мало, скажу откровенно - я впервые поставил на закачку UnrealEngine
     
    Last edited: Mar 30, 2015
    IlyaKo likes this.
  10. skirtz1

    skirtz1

    Joined:
    Mar 8, 2015
    Posts:
    20
    @yant: Though I had to kick scaling and rotation support out of the initial 5.0, I hope scaling returns early 5.x and then rotations will follow on.

    Rotation is basic property for all Unity objects transforms. It existed for wheel colllider in 4.x and is not implemented it in 5.0. This creates severe incompatibility. Any project that positions the wheels will fail and will not be able to use the "new" wheel collider AT ALL. There is no workaround for this! Because of this incompatibility I can not migrate my code and can't use 5.0 which I paid for.

    The code we write is our biggest and most expensive investment. Creating this terminal incompatibility devalues this investment. We deserve full backwards compatibility and nothing less. I would like to hear from you WHEN will be rotation implemented and not vague promises.

    I want you to understand, that these are the things that make people consider moving to anther platform. You just can't randomly change established behavior and release 5.0 version effectively with NO wheel colliders.
     
    Last edited: Mar 30, 2015
    afftar likes this.
  11. pauloaguiar

    pauloaguiar

    Joined:
    May 13, 2009
    Posts:
    698
    i don´t understand? how to put the motorTorque and breakeTorque working currently?
    the car have the default settings accept size radius and mass to 1000.
    the car to move the motorTorque throttle is 2500., the breakeTorque no affecting?!
    Any simple script sample in JS to show how to do correctly?
    Crazy values!
     
  12. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    757
    Yeah, I submitted that bug (unless someone else reported the same thing). :)

    It'd be great to get settings for something like a 10,000kg vehicle that can drive at a decent speed via motorTorque, with enough wheel friction to not be free-spinning the wheels and sliding around a lot. I haven't been able to create something like that because introducing enough friction to the wheels also introduces major physics jitter.

    As others have mentioned also, it seems weird that any values can create a system where the wheel produces more energy than it takes in.
     
  13. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It is an illusion to believe that this can be achieved for mayor updates. No software package can guarantee full backwards compatibility.
     
    Brainswitch likes this.
  14. skirtz1

    skirtz1

    Joined:
    Mar 8, 2015
    Posts:
    20
    You are wrong. This is not a minor incompatibility that have work around. This is a showstopper. The ability to position an object is as basic as they come. The "new" wheel collider does not take into account the parent orientation (or even its own transform). This means you can not position the wheel collider and that feature can not be re-engineered. Effectively, there is NO wheel collider in Unity 5.0.
     
    Last edited: Mar 30, 2015
    afftar likes this.
  15. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I am not talking about the short comings of the new wheel collider, but about full backward compatibility. Full backward compatibility is impossible to achieve when mayor updates are made, especially in areas like a physics engine.
     
    Brainswitch likes this.
  16. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @skirtz "Effectively, there is NO wheel collider in Unity 5.0."

    This is an obvious over-generalisation. The logic looks to me pretty much like [We can't land the Sun as we could do with the Moon, so effectively we have no Sun.]

    It's clear the current WheelCollider has it's usage, and anger with strong language would never help you realise that, I'm afraid. Of course, the current implementation has it's shortcomings and I think I've been pretty open about those in the thread. I can't really post more information when I don't have it, please understand.
     
  17. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @Nition I'll be looking at that shortly.
     
  18. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @afftar I have to say that I'm able to answer posts in English only, as posting in other languages on international forums, like you just did, basically excludes people from the discussion.

    Regardless, I will take a look on what's going on in the configuration you provided.
     
  19. skirtz1

    skirtz1

    Joined:
    Mar 8, 2015
    Posts:
    20
    @yaht: It's clear the current WheelCollider has it's usage

    80% of your customers think it is unusable... is that "obvious over-generalization" as well?

    I still can not get answer to my simple question:

    - When we will be able to position wheel collider using rotation?

    PS:

    I want you to know that this Unity customer (me) paid for Unity 5.0 upgrade $2250, downloaded it and because of this issue can not use it. Lack of rotation means that I can not position the wheels in my projects and there is no work around. To top that, it seems that developer that could fix that refuses to provide any answers as to when this will be fixed and fails to recognize the importance of keeping backward compatibility for MAJOR features.

    So now I am stuck with product I can't use and there is no recognition of the problem and no date when this will be fixed.
     
    Last edited: Mar 31, 2015
  20. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I know that this starts to sound annoying, but this is simply not true. Maybe it is true, but it is impossible to know. You basically made up a number to justify your point, but this doesn't help you, because you can't know those kinds of numbers.
     
  21. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    226
    Hello Yant, what you are working on now regarding physx and what are nearest plans for it?
    Also thank you for detailed explanation of how new WC works, very helpfull.
     
  22. skirtz1

    skirtz1

    Joined:
    Mar 8, 2015
    Posts:
    20
    @Dantus: ... You basically made up a number to justify your point...

    Dantus, It seems you are uninformed again. Look at the poll at the top of this thread.

    What do you think about new WheelCollider component?
    This poll will close on Apr 3, 2015 at 8:22 PM.
    1. *
      It is unusable and needs reingeenering.
      53 vote(s)
      79.1%

    2. It is suitable for use
      14 vote(s)
      20.9%
    Change Your Vote
     
  23. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    The conclusion is that Unity has exactly 67 users. I indeed didn't know that. Thanks for the info.
     
    LaneFox likes this.
  24. mmorpg-fps-rts-zombie

    mmorpg-fps-rts-zombie

    Joined:
    Jan 25, 2015
    Posts:
    22
    Please don't derail this thread. It needs to stay open. Let yant reply.

    Thank you.
     
  25. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I would have closed the thread long ago due to disproportional complaints.
    It is not my intention to derail this thread, but pointing out statements that are clearly wrong and than being corrected in this way deserves some sarcasm.
     
  26. skirtz1

    skirtz1

    Joined:
    Mar 8, 2015
    Posts:
    20
    @Dantus: I would have closed the thread long ago due to disproportional complaints.

    Can you please elaborate?
    1. Who are you to close the thread (in what authority)?
    2. Who are you to decide there are "disproportional complaints" (who gave you that discretion?)
    3. Is that Unity official position to remove customer posts that point to product problems?

    I am repeating again my question:
    - When we will be able to position wheel collider using rotation?
     
  27. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It is my personal opinion and I will keep it. It is my right to have my opinion as far as I know.

    This was already answered somehow here, not sure what kind of answer you expect. This kind of information is more than many other companies offer,
     
  28. skirtz1

    skirtz1

    Joined:
    Mar 8, 2015
    Posts:
    20
    @Dantus said: I would have closed the thread long ago due to disproportional complaints

    So you are common troll pretending to be admin...
     
  29. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I don't pretend to be an admin. It is clearly visible who is an admin in this forum.
    Sorry, that's my last reply to this kind of comment, because it is definitely off topic.
     
  30. skirtz1

    skirtz1

    Joined:
    Mar 8, 2015
    Posts:
    20
    Thank you, so now I can repeat my post and please do not interrupt it.

    -----------------------------------------------------------------------------------------------------------

    @yaht: It's clear the current WheelCollider has it's usage

    80% of your customers think it is unusable... is that "obvious over-generalization" as well?

    I still can not get answer to my simple question:

    - When we will be able to position wheel collider using rotation?

    PS:

    I want you to know that this Unity customer (me) paid for Unity 5.0 upgrade $2250, downloaded it and because of this issue can not use it. Lack of rotation means that I can not position the wheels in my projects and there is no work around. To top that, it seems that developer that could fix that refuses to provide any answers as to when this will be fixed and fails to recognize the importance of keeping backward compatibility for MAJOR features.

    So now I am stuck with product I can't use and there is no recognition of the problem and no date when this will be fixed.
     
    darkhog likes this.
  31. afftar

    afftar

    Joined:
    Apr 18, 2014
    Posts:
    54
    Just leave it here
     
  32. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Did you try to place the wheels precisely around the car? If you place the wheels in an unbalanced way around the car, the center of mass is not anymore in the center of the car which automatically leads to issues.
     
  33. afftar

    afftar

    Joined:
    Apr 18, 2014
    Posts:
    54
     
  34. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    We all know the WheelCollider is not working reliable in several cases and that the range it which it acts stable is not that huge. So breaking it is not such a big deal, especially not if you don't even balance it.
     
  35. afftar

    afftar

    Joined:
    Apr 18, 2014
    Posts:
    54
    darkhog likes this.
  36. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Who said that the wheel colliders are physically accurate? They are obviously not and as such they can have this kind of side effects, maybe along with numerical instabilities. Everyone who had a glance at this thread understands this by now. It is sufficient to point the weaknesses out once.
    If you can't live with that, you have to use something else. Create your own wheel colliders, use the ones someone else has created. There is no solution from Unity right now, that's it!
     
  37. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    757
    I don't think that was afftar's issue, just because I just did some tests with this and I can't repeat your results. For all the things that are weird with the new wheel colliders, wheel position relative to centre of mass doesn't seem to be one of them. If I have a vehicle that's good with a central centre of mass, it also seems to behave appropriately with one that's way off. Which is good because most vehicles don't have their centre of mass right in the centre!

    I won't say for sure it's not an issue though because there's plenty of "There's a bug with...", "No there isn't..." in this thread already.
     
  38. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @Roni92 "what you are working on now regarding physx and what are nearest plans for it"

    Currently I'm spending most of my time helping developers with upgrading projects and resolving arising issues. We're having quite an influx of bugs and questions, but I'm still doing my best to answer pretty much everything. One of the next patch releases of 5.0 will contain a bunch of fixes Morten and myself did to address issues people found. We're testing a more stable implementation of HingeJoint for instance, there are some smaller fixes in the pipeline also. We're updating PhysX with a patch that would solve crashes when an object generates more than 64 contacts (this seems to be quite an often cause of crashes now). Stay tuned to the patch release notes.

    Lately, I did a quick experiment to get a convex decomposition library working in Unity (V-HACD). This is to automatically decompose any user mesh into a set of convex MeshColliders. There is some work to be done yet to have it up to a shippable state, but that should happen somewhere early 5.x.

    As for the full roadmap, it's not that easy to share. Our current development model suggests to include stuff in release plans only when we're certain it's ready. We have a very lengthy TODO / backlog, and we're doing work on various fronts besides just pure bugfixing, but it's sometimes challenging to say when something could be expected to be present in a public build.
     
    varfare likes this.
  39. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I did exactly the same car that afftar did for testing purposes, but aligned the wheels symmetrically around it and there was no issue. However, when I just placed them randomly around the car, I got exactly the same issue as shown in the video. It seems to be sufficient to at least aline the axles, such that the center of them is aligned on a line which intersects the center of mass.
     
  40. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @Dantus I think there is a couple of issues with that configuration. First, forceAppPointDistance seems to be set to zero. It should be close to within 30cm the center of mass in a typical car. Second, the car's body is simply too small relative to the car's bounds for the current PhysX to simulate that reliably. One way to solve the second issue would be to manually increase inertia tensor or to simply scale the car's body so that it looks more like a car not like a spider. EasySuspension might work out a better setting for WC given the asymmetric configuration. Reuse ideas from EasySuspension where possible.

    We're working closely with Nvidia on improving PhysX Vehicles, and I think the future versions would be working with a wider range of settings in a more stable way, but currently we have what PhysX had to offer. It requires very careful configuration.
     
  41. Eduard

    Eduard

    Joined:
    Nov 24, 2012
    Posts:
    10
    I am also struggling with the new wheelcollider, I can t get it work properly with high weights at all, the tank just bounces off the terrain. I already changed the fixed time stamp and iterator counts and played around with all kinds of settings.

    I wanted to port our project to Unity5 to make use of all the new features like audio mixers, PBS ..., but this wheelcollider issue is a show stopper right now. Unfortunately our vehicles use more that 4 wheels, which doesn t make the problem easier.

    Currently I consider the following options
    a) Use Capsules and ConfigurableJoints (don t know if that works properly with tanks)
    b) Stay with Unity 4.6 and use one of the PBS shader frameworks available (sadly enough I already upgraded to Unity5 already)

    @yant: Would it be possible to get the source code of the Unity 4.X WheelCollider implementation? Maybe release it as open source so we can atleast get our projects ported to unity5.

     
    afftar likes this.
  42. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,868
    There is a workaround. Vehicle Physics Pro support rotations in the WheeCollider correctly. Please contact me by pm.
    EDIT: WheelCollider rotations are not supported in Unity 5.0. I can calculate the correct contact point, but the WheelCollider always applies the suspension vertically. AFAIK this should be fixed at some point in the 5.X cycle.

    Yes, I use my own tire friction model. Unfortunately, I've been unable to extract any logic of the torque vs. slip vs. force values in the new WheelCollider.
     
    Last edited: Apr 8, 2015
  43. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    438
    @Eduard Have you tried the EasySuspension project that I shared earlier in this thread?
     
  44. afftar

    afftar

    Joined:
    Apr 18, 2014
    Posts:
    54
    Not everyone needs a car: / How to be if I want to do is not 4 wheel cars?
    Its Unity4:

    If I want destructible car? Destructible wheels? Unity4 supported this :( Unity5 for me was useless

    +1
    Or "legacy" check box in WheelCollider?
     
    Last edited: Apr 1, 2015
  45. Brainswitch

    Brainswitch

    Joined:
    Apr 24, 2013
    Posts:
    270
    I don't think that's possible, the old WheelCollider is probably tightly coupled with the old PhsyX code. They would need to recreate the entire thing and make it work in PhysX 3. Which would take a lot of time and effort, time and effort I'd rather have them spend on improving the new WheelCollider.
     
    yant likes this.
  46. Eduard

    Eduard

    Joined:
    Nov 24, 2012
    Posts:
    10
    I had a look at the project and tried to do the same with my vehicle setup without luck.

    In the meantime I got the WheelColliderSource implementation from the wiki. After some adjustments this works half way reliable with my current setup, but it has some flaws that make it instable in some situations.


    In Unity4 I had 20 GameObjects that served as wheels. Each GameObject had a rigidbody conntected to the root of the vehicle using ConfigurableJoints along the Y axis. The wheelcollider just served as a collider. The advantage of this setup was that my tanks could swing around when breaking or driving across tiny hills, thats not the case with the new setup anymore where these GameObjects are just children of the root without a rigid body assign to them.

    I just can t configure the ConfigurableJoint to be stable at all.


    I am going to refine the WheelColliderSource further more, but it would be really helpful if Unity would decide to release the old WheelCollider as open source, that would certainly help a lot of people here struggling with the new collider.

    In your blog you already mentioned that you would release parts of the engine as open source.
     
  47. Eduard

    Eduard

    Joined:
    Nov 24, 2012
    Posts:
    10
    The WheelColliderSource was developed to resample the original collider and its working pretty decent, but needs improvements. And it would take quite some time until unity devs can improve the new collider and we had to wait for one of the upcoming releases. I guess we are talking about 3-6 months then.

    Time a lot of studios working with unity5 do not have.

    In the meantime they could support us with releasing the old collider as open source.
     
  48. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,676
    No one is required to work on the cutting edge of technology. Studios take this into considering and expect to work around issues like this on their own and provide constructive feedback for missing features.
     
  49. Eduard

    Eduard

    Joined:
    Nov 24, 2012
    Posts:
    10
    The strength of the unity engine is its huge community with developers providing addons/alternatives in the assetstore for free or a few bucks. Its not like we are working on cutting edge technology, wheelcolliders or usable physic engines are standard for years now and anyone who was waiting for unity5 be release would certainly expect such basic features to work. But looking at the poll this doesn t seem to be the case.
     
  50. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,676
    Sure but its clear that it can work, they're aware of outstanding issues, are working on them, and if PhysX 3.3 wheel setup isn't working for your uses then Unity 4.x and legacy wheels are always there or use a 3rd party solution from the asset store.
     
unityunity