Search Unity

Wheel collider space to stop car

Discussion in 'Physics' started by radamirez, Jun 3, 2018.

  1. radamirez

    radamirez

    Joined:
    Jun 3, 2018
    Posts:
    1
    Hi guy , i have implemented a car with four wheel collider like the official tutorial.
    The car is more realistic like apply a force .
    I need to know how many metres the car need to stop, but without know the decelleration force.
    It is possible?
    space to stop is approximately equal to velocity ^2 / decelleration;
    and i can get the velocity by rigidbody.

    And another question, can i set an acceleration parameter and the torque adapt its value? or set a velocity cruise to take my car at the same velority ?

    i can calculate the past acceleration with old velocity and currVelocity but in the future frame this value can change.

    thanks
     
  2. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    Wellcome to this forum. I'm a user.
    At 100km/h ~50m or units [link]
    I do not use the wheel collider. I use a sphere and a joint.
    To get the wheel speed I pick up the radius of the weel and the revolutions per second.
    I apply a torque opposite to revolution and full brack when stop blocking the joint. But probably there is way more optimise ways in the asset store or search here in the forum.
    For the cruse velocity, you can apply torque up to a point the car is not accelerating any more. You need some drag (aerodynamic or revolution). You can apply less torque when the weel is increasing in revolutions. And then play with the value via inspector.