void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Bullet") { // Generate Random directions for the new small asteroids that needs to be spawned after this asteroid is destroyed CreateRandomDir(); // Spawn two small Asteroids by calling AsteroidSpawner script attached to camera _asteroidSpawner.SpawnSmallAsteroid(this.transform.position, dir1); _asteroidSpawner.SpawnSmallAsteroid(this.transform.position, dir2); Destroy(this.gameObject); Destroy(other.gameObject); // Destroy Bullet GameObject anim = Instantiate(explosion) as GameObject; // Play explosion prefab anim.transform.position = this.transform.position; Destroy(anim, 2.0f); } }