// Update is called once per frame
 void Update()
 {
     if (Vector3.Distance(player.transform.position, gameObject.transform.position) < 0.3f)
     {
         playerGetKey.KeyGot();
     }
 }
Exemplo n.º 2
0
 void Update()
 {
     if (Vector3.Distance(player.transform.position, gameObject.transform.position) < 1f)
     {
         playerGetkey.KeyGot();
         Destroy(gameObject, 0.5f);
     }
 }