Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // outside of the class, below "Using UnityEngine"
- using Random = UnityEngine.Random;
- // make sure to initialise this properly
- fudgeFactor = 30;
- // inside the update function
- atan2 = Mathf.Atan2 (v_diff.y, v_diff.x);
- Quaternion newAngle = Quaternion.Euler (0f, 0f, atan2 * Mathf.Rad2Deg + Random.Range( - fudgeFactor, fudgeFactor) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement