daily pastebin goal
23%
SHARE
TWEET

e

a guest Jun 16th, 2011 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var target : Transform;
  2.  
  3. function Update () {
  4. var other = gameObject.GetComponent("destroy enemy");
  5.  
  6. if ( Vector3.Distance(target.position, transform.position ) < 5) {
  7. other.enabled = true;
  8. }
  9. if ( Vector3.Distance(target.position, transform.position ) > 5) {
  10. other.enabled = false;
  11. }
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top