Skip to content

Instantly share code, notes, and snippets.

@nasser
Created June 21, 2014 02:22
Show Gist options
  • Save nasser/119742def76a4ef6138a to your computer and use it in GitHub Desktop.
Save nasser/119742def76a4ef6138a to your computer and use it in GitHub Desktop.
void Start () {
InvokeRepeating ("NewTarget", 3, 3);
}
void NewTarget() {
target = GameObject.FindGameObjectsWithTag ("Enemy").Where(go => go.transform.position.z > 5).Shuffle ().FirstOrDefault ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment