Skip to content

Instantly share code, notes, and snippets.

@tracend
Created March 29, 2011 23:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracend/893545 to your computer and use it in GitHub Desktop.
Save tracend/893545 to your computer and use it in GitHub Desktop.
Unity3D: Measure distance
function Update() {
if ( Vector3.Distance( enemy.position, transform.position ) < 10 )
print("I sense the enemy is near!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment