Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // outside of the class, below "Using UnityEngine"
  2. using Random = UnityEngine.Random;
  3.  
  4. // make sure to initialise this properly
  5. fudgeFactor = 30;
  6.  
  7. // inside the update function
  8. atan2 = Mathf.Atan2 (v_diff.y, v_diff.x);
  9. Quaternion newAngle = Quaternion.Euler (0f, 0f, atan2 * Mathf.Rad2Deg + Random.Range( - fudgeFactor, fudgeFactor) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement