Quantcast
Channel: Answers for "Changing rigidbody drag based on deviation of rigidbody heading to its direction"
Viewing all articles
Browse latest Browse all 6

Answer by Ryder

$
0
0

Ok, here is the answer... Thanks to Flynn in forums for the assist!

All you need is to get the degress of deviation from the oriention of the object to its velocity...

var dif = Vector3.Angle(rigidbody.velocity,transform.up); 

(This assumes that forward is in a positive Y direction in the rigidbody's local space)

once you have the deviation in degrees, you can perform any math on it to get a new drag value.


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images