daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  private void ApplyForces()
  2.         {
  3.             if (tiresOnGround > 0 || airTime < 0.3f)
  4.             {
  5.                 //stop sliding sideways//
  6.                 physicsRigidbody.AddForce(physicsBody.transform.right * WheelVelocity.x * -(tireGrip * 140f) *
  7.                                           Time.fixedDeltaTime);
  8.  
  9.                 //downforce//
  10.                 if (downForce > 0)
  11.                     physicsRigidbody.AddForce(Vector3.down *
  12.                                               (Mathf.Abs(WheelVelocity.z) * downForce * 0.1f *
  13.                                                physicsRigidbody.velocity.magnitude) * Time.fixedDeltaTime);
  14.             }
  15.             else
  16.             {
  17.                 if (airTime > 0.3f)
  18.                 {
  19.                     //increase gravity//
  20.                     physicsRigidbody.AddForce((Physics.gravity * physicsRigidbody.mass) * 2f);
  21.                 }
  22.             }
  23.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top