Last active
August 29, 2015 14:22
-
-
Save Henry-E/6fec2faed1ebe696ae9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment