JustInvoke / Randomation-Vehicle-Physics

Vehicle physics system for the Unity engine.
https://justinvoke.com/game-assets/#randomation-vehicle-physics
865 stars 184 forks source link

Rigidbody Mass Doesn't Affect The Drive Force #21

Closed wbstttggm closed 7 years ago

wbstttggm commented 7 years ago

I found this issue when i was changing the vehicle rigidbody mass to a large value. The vehicle keeps moving fast.

and i found this code in Wheel.cs: rb.AddForceAtPosition(frictionForce, forceApplicationPoint, ForceMode.Acceleration);

change to" rb.AddForceAtPosition(frictionForce, forceApplicationPoint, ForceMode.Force);

For the best result, make a member variable ForceMode globalForceMode; in Vehicle parent, and replace all ForceMode.Acceleration to vp.globalForceMode. It will also affect the suspension behavior that was previously doesn't respond any rigidbody mass changes.

JustInvoke commented 7 years ago

I will take a look at this when I can.

JustInvoke commented 7 years ago

Added new wheel force mode and suspension force mode variables to VehicleParent.