Search Unity

[car physics] different scale means different gravities and different masses ?

Discussion in 'Physics' started by CloudFs, Jul 8, 2017.

  1. CloudFs

    CloudFs

    Joined:
    Jun 19, 2014
    Posts:
    64
    hey, guys, i have made a terrain in blender and a car too
    now, because everything's scale is 100 .. i needed to put the gravity into 109.8 ..
    for everything to work normally

    now i scaled my car to 18 from 100 (smaller much smaller)

    the car and the terrain both have rigidbody ..
    the mass of the terrain is 1 and the mass of the car is 1 ..
    the problem now is when i add the wheel colliders the car start vibrating alot in its place .. how do i solve this
    ..
    and returning to my question .. does changing scale means giving different gravities? and masses ? to similar objects?


    this is a video showing my problem.

     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Different gravities: Yes, if you want the same behavior.
    Masses: I guess you can leave those at the same value, it is just important how they are set in relation to the other objects.

    Otherwise take a look at the spring behavior of the wheel colliders, tr to play around with their values.
     
  3. CloudFs

    CloudFs

    Joined:
    Jun 19, 2014
    Posts:
    64
    apparently, this is a bug in unity .. that has existed in a long time yet never fixed. no matter what i do it still vibrates the only way to fix it is by turning down the gravity by 100 but the problem is that when objects jump of sumthing they keep floating some I'm thinking about triggering a change in gravity using script every time the car jumps and is floating in the air .. car in the air gravity Y -109.81 .. car on the floor gravity Y -9.81 ... i think that would be the only solution for now

    wheel colliders are really S***ty .. i'm making an endless racer do you have a better way to make a car that moves left and right?
    i was thinking maybe using a box collider and just loving it like primitive objects but it is not stable it keeps flipping and turning upside down because of speed or friction i'm not sure
     
  4. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    I made a cart racing game once and ditched the wheel colliders to work with box colliders (Kind of like ice blocks with zero friction), which worked really well at first, but once you get to slopes and uphill downhill passages, wheel colliders do a really good job. So I switched my whole system to wheel colliders after working ~8 months with the block solution and it was a really good decision, even though it hurt. I recommend getting the wheel colliders working, you really just have to play around a bit with the spring settings in the wheel collider.

    Changing the gravity is a good idea, but I wouldn't change the Physics.gravity, but rather just set a downforce for the car, that changes when it is on the ground and when it is in the air. Take a look at the car project from unity in the standard assets. They get the car to behave really well.
     
  5. CloudFs

    CloudFs

    Joined:
    Jun 19, 2014
    Posts:
    64
    hey just in case you wanted to know i successful made great car controller ...
    but i'm having this small issue with slow reaction time when braking and accelerating .. may be you have an idea ..
    here's my thread
    https://forum.unity3d.com/threads/slow-car-reaction.489091/