void OnCollisionEnter(Collision collision) { ContactPoint contact = collision.contacts[0]; Quaternion rot = Quaternion.FromToRotation(Vector3.up, contact.normal); Vector3 pos = contact.point; GameObject collidedWith = collision.gameObject; if (collidedWith.tag == "player") { Instantiate(explosionPrefab, pos, rot); PHB.TakeDemage(TakeDemage); Destroy(gameObject); if (PHB.currentHealth <= 0) { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } } Instantiate(explosionPrefab, pos, rot); Destroy(gameObject); }