public void OnTriggerEnter(Collider other) { Debug.Log(other.gameObject.name + "Objenin içinden geçtin"); if (other.gameObject.name == "Nokta1") { Yol2.transform.position = new Vector3(Yol1.transform.position.x, Yol1.transform.position.y, Yol1.transform.position.z + Yol1.gameObject.GetComponent <Terrain>().terrainData.size.z); Debug.Log("Objenin adı Nokta1 imiş"); } else if (other.gameObject.name == "Nokta2") { Yol1.transform.position = new Vector3(Yol2.transform.position.x, Yol2.transform.position.y, Yol2.transform.position.z + Yol2.gameObject.GetComponent <Terrain>().terrainData.size.z); Debug.Log("Objenin adı Nokta2 imiş"); } else if (other.gameObject.tag == "PuanAlinabilir") { audioSource.PlayOneShot(AltinSesi); // Altın alındığı zaman bir kere bu sesi çalıştır demek bu kod. panelKontrol.PuanHesapla(); Destroy(other.gameObject); } else if (other.gameObject.tag == "Miknatis") { MiknatisAktifMi = true; MiknatisKalanSure += MiknatisSuresi; panelKontrol.KalanMiknatisSüre.enabled = true; Destroy(other.gameObject); } else if (other.gameObject.tag == "Engel") { panelKontrol.BittiPanel.SetActive(true); Time.timeScale = 0.0f; } }