Guest User

Untitled

a guest
Jun 19th, 2011
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var target : Transform;
  2. private var other;
  3.  
  4. void Start()
  5. {
  6. other = gameObject.GetComponent("question1");
  7.  
  8. if ( Vector3.Distance(target.position, transform.position ) < 5) {
  9. other.enabled = true;
  10. }
  11. if ( Vector3.Distance(target.position, transform.position ) > 5) {
  12. other.enabled = false;
  13. }
  14. }
RAW Paste Data