I have a object that moves by “Rigidbody.AddForce” which move it towards the direction its facing but when the object goes to turn the velocity from the direction it was going is still in effect so it slides sideways. Is there a setting or option somewhere in the rigidbody component which slows down side drag but doesn’t reduce forward drag, i want it to transfer the velocity from the direction it was going into the new direction instead of sliding i cant script this because i don’t know how to get and compare the direction between vectors.
First find objects’ lateral velocity then apply force in the opposite direction. Something like:
float sidewaysdragmultiplier = 1; //how fast do you want your object to slow down
Vector3 velocity = Transform.InverseTransformDirection(rb.velocity);
rb.AddForce(transform.right*-velocity.x*sidewaysdragmultiplier);
2 Likes
Thanks this was helpful :).
1 Like
this also worked thanks plus it was super simple so double thanks
Please use the Like button rather than necroing a nearly 7 year old thread.