Guest User

Untitled

a guest
Jun 19th, 2011
112
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("question1");
  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