Search Unity

What kind of a Vehicle would you like to see built with Wheelcollider?

Discussion in 'Physics' started by Griautis, Nov 4, 2015.

  1. Griautis

    Griautis

    AI & Physics STE Unity Technologies

    Joined:
    Jan 26, 2013
    Posts:
    63
    Hello there,
    I'm tester for Physics system in Unity. To test wheel colliders, I am planning to try and build a vehicle in Unity with it, and see how that goes. The results of this would be twofold:
    A) More testing and more fixing of Wheel collider
    B) A done project which I could share with everyone here and a blog post next to it how it went.

    This way, I hope to be able to teach everyone more about the wheel collider while simultaneously learning more about it myself.

    So my question here is, what kind of a vehicle I should start with? An average car, to benefit the most of you? Motorcycle? Tank? Tricycle? 20 wheel monster? :)
     
    Todd-Wasson and pauloaguiar like this.
  2. pauloaguiar

    pauloaguiar

    Joined:
    May 13, 2009
    Posts:
    700
    Cool and welcome thread:).

    You should begin with the basics and then to the advanced.
    What else do I like to learn, is how to create and use wheelCollider in motorcycle and control.
    And this is it:)

    You demonstrate in videos or text?
     
  3. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Nothing challenging about most of those except motorbike.

    do motorbike. interested to see your approach.
     
    pauloaguiar likes this.
  4. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    My humble dream is to have some "light version" of wheel collider, as my use case is tank. Lot of tanks. Lot of wheels. Performance. Problems. And no, creating own system is not solution as scripted solution will never be as fast as "native" Unity implementation. Scripts are just slow.
     
  5. Bidsy

    Bidsy

    Joined:
    Sep 15, 2015
    Posts:
    14
    I would like to see a haul truck, 2 front and 4 rear wheels. A tilt tray at the back would be nice too. I have been trying for days to achieve this and I am struggling to make the truck move. Any tutorial would help me really
     
  6. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    @Roni92pl I would avoid wheel colliders in a tank setup. Theres no real gain and they aint really designed for it. I just faked it with inferno (see sig) using MovePosition to trundle the tank around.

    @Bidsy try the wheelcollider script in my sig.. Its capable of doing wheel setups like you mention. Make sure you remove any wheel colliders already on your vehicle before you try it. Its intended to set it self up (searching through the transforms and finding the wheels and creating the wheelcolliders, etc
     
  7. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Yup, you can use MovePosition when you don't need them to move in physically realistic and visually pleasing way ;)
     
  8. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Considering I went around the block trying different tank movement techniques, I can say MovePosition works best. Better than trying to put wheelcolliders on.
     
  9. LearningNot

    LearningNot

    Joined:
    Sep 30, 2015
    Posts:
    106
    make a buldoser
     
  10. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    I take back my previous request. I just want them work with slower fixed time update than default 0.02. I set 0.04 and vehicle is behaving very wrong.
     
  11. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Im curious why you are winding your time step back that far?
     
  12. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    I think it's pretty obvious - performance, and 25hz of physics calculations is enough for me.
     
  13. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Obvious? hardly.

    I prefer my physics to be smooth and accurate. High time step will give you anything but.
     
  14. MacStanley

    MacStanley

    Joined:
    Jul 18, 2013
    Posts:
    118
    Hallo Griautis,

    definitely trailers for cars. Seems to be some kind of challanging to get these to work.

    I`ve tried myself but there seems to be some kind of problem with thesuspension springs position. You can find more details here :) http://forum.unity3d.com/threads/wh...ers-only-rolling-at-spring-position-0.367118/

    Not sure if its some kind of bug, problem or just something I did wrong. But would be happy to hear about your testings when experimenting with trailers.
     
    pauloaguiar likes this.
  15. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,525
    4x4 Jeep. They're lots of fun and the proper suspension constraints are critical.
    A contrasting stiff suspension street race car type would be a good second example.

    I think that would cover the spectrum decent, doing a vehicle with tons of wheels would be cool but I don't think very practical as an example. Tanks are neat too, but probably not in-demand enough to justify priority over a Jeep + Streetrace Car spread.
     
  16. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    An average car should be a good starting point for most users. Then, I'd like to see your approach on some advanced setups:
    • Motorcycle, where WheelColliders should work at sharp angles with the ground (this actually fails with cars).
    • Cargo truck, where the load is provided via additional rigidbodies (as seen here). WheelColliders support a non-predictable load without modifying their settings.
    • Tank, where two rows of WheelColliders are used for simulate the tracks. Each row should apply the same longitudinal force, no matter whether all of them are grounded, of just one or two of them. They should also spin at the low speeds typical of a tank.
    These situations should expose most of the actual problems we're experiencing with WheelColliders.

    Thanks!
     
  17. Bidsy

    Bidsy

    Joined:
    Sep 15, 2015
    Posts:
    14
    Hi James

    @Bidsy try the wheelcollider script in my sig.. Its capable of doing wheel setups like you mention. Make sure you remove any wheel colliders already on your vehicle before you try it. Its intended to set it self up (searching through the transforms and finding the wheels and creating the wheelcolliders, etc[/QUOTE]

    Thanks for the SimpleWheel script, though I am having a little trouble make this to work. After dragging the script onto my vehicle I get an error "WheelCollider requires an attached Rigidbody to function". Any suggestions as to how I fix this?

    Thanks
     
  18. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    odd, the script should add a rigidbody.. did you have any existing components on the vehicle?
     
  19. SuperVoximus

    SuperVoximus

    Joined:
    Nov 5, 2013
    Posts:
    102
    How about a skateboard?
     
  20. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    I'd be interested to see a car with wheels that can move relative to the rigidbody they are attached to. This would be a car that can change the axis width and the distance between the axes while driving. That's a case where I had a lot of problems in U5, which worked well in U4.

    If it's not clear what I mean, in this video you see the wheels moving together when flying (0:35).