Search Unity

Using Standard Assets, Wheel Collider shaking airplane when I change the scale?

Discussion in 'Physics' started by dbarrett, Nov 6, 2017.

  1. dbarrett

    dbarrett

    Joined:
    Sep 6, 2017
    Posts:
    32
    So I am using the sample jet from the Standard Assets but, it was a little too big for what I wanted so I wanted to scale it down some. Well, when I scale down the jet the wheel colliders are constantly shaking even when the aircraft isn't moving this also causes the aircraft not to take off as it is stuck on the ground collider. Is there something I can do to fix this?

    I saw there were places where people said to use Rigidbody.AddForce to stop this but, the script is already doing this. Are there any other ways to stop the shaking?
     
  2. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    236
    Wheel colliders are tricky to set-up properly. Shaking and or bouncing is typical when not right.
    When you scaled the jet, did you also change the jet's Rigidbody mass (weight) to something appropriate for it's size?
    Did you change the Wheel Collider mass to something appropriate for it's size?
    You would also need to change the spring tension and damping values to suit the above weights.
    I have a 650 mass airplane with wheels that have a mass of 20 with Spring 10000 and Damper 5000.
    They work fairly well. I hope this helps as a guide.
     
  3. dbarrett

    dbarrett

    Joined:
    Sep 6, 2017
    Posts:
    32
    Well for some reason the airplane falls through the ground at the wheels when it is a smaller scale. I have used planes, quads, and terrain and changing that didn't help. Is there a way to use sphere colliders or something instead? What is an alternative to wheelCollider.motorTorque?
     
  4. dbarrett

    dbarrett

    Joined:
    Sep 6, 2017
    Posts:
    32
    I solved it by moving the wheel colliders directly under the parent object instead of it being a child of a child object. Doesn't make sense to me but, it worked.

    EDIT: I'm dumb lol I turned off gravity no wonder it worked I turned it back on doesn't work again
     
    Last edited: Nov 7, 2017
    richardgengle likes this.
  5. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    236
    Try working close to real world size and Rigidbody mass. 1 unit = 1 meter or 1 kg. Then depending on size of your plane, use my Wheel Collider example for determining mass, spring and damper values.
    If you want to get away from using Wheel Colliders then just use a Mesh Collider or Box Colliders and make the surface slippery by applying a physics material like ice. Then you can just slide along the ground until lift-off!
     
  6. dbarrett

    dbarrett

    Joined:
    Sep 6, 2017
    Posts:
    32
    For some reason when I use box colliders and the ice material I still can't get the plane to move.

    EDIT: I got it this time haha added an ice material to the new wheels and the ground and it moves at least lol
     
    Last edited: Nov 7, 2017
  7. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    236
    OK then, just be careful not to slide all the way off the edge of the polar cap otherwise you might hit a penguin. ;-)