Search Unity

Apply side ways and forward friction

Discussion in 'Physics' started by michealcaj, Dec 18, 2018.

  1. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191
    Hey guys this has been an issue for days I can't seem to figure it out, well all I want to do is apply friction force to the wheels of my car, I don't make use of the wheel collider system I built mine using raycast

    This is my friction code

    Code (CSharp):
    1. Var dragx = Mathf.Pow( Rb.Velocity.x,2) * drag;
    2.  
    3. Var dragvecx = dragx * -velocity.normalized;
    4.  
    5. Rb.AddForceAtPosition(dragvecx,transform.position);
    6.  
    Any idea how to get that infinite grip