Skip to content

Instantly share code, notes, and snippets.

@hawksprite
Created April 29, 2015 18:28
Show Gist options
  • Save hawksprite/5055e574183299a4319d to your computer and use it in GitHub Desktop.
Save hawksprite/5055e574183299a4319d to your computer and use it in GitHub Desktop.
New Location
Vector3 newLocation(){
newLocation = new Vector3(Random.Range(-40,40),Random.Range(-40,40),Random.Range(-40,40));
while(Vector3.Distance(playerLocation, newLocation) < 20){
newLocation = new Vector3(Random.Range(-40,40),Random.Range(-40,40),Random.Range(-40,40));
}
return newLocation;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment