Advertisement
wasdswag

unity - compare directions

May 25th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.20 KB | None | 0 0
  1. // https://stackoverflow.com/questions/29916137/unity-rotation-difference-and-direction
  2.  
  3.   float dot = Vector3.Dot(current.transform.forward, finalPosition.transform.forward);
  4.   matchDirection = dot >= 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement