Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // AIRMOVE STUFF
- void CalculateDrag(Vector3 direction, Vector3 velocity) {
- dotP = Vector3.Dot(velocity.normalized, direction);
- if (dotP < 0) {
- dotP *= -1;
- drag = dotP * dragMulti * (1 - dotP * 0.9f);
- direction = direction + velocity.normalized * 0.1f;
- body.AddForce(direction * drag * Time.deltaTime, ForceMode.Acceleration);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement