IEnumerator OnTriggerEnter2D(Collider2D other) { score = GameObject.Find("Score").GetComponent<ScoreController>(); if (other.tag == "Rock") { yield return new WaitForSeconds(hellaWait); if(tag == "Player") { objectPos = transform.FindChild("turtle_shell").transform.position; score.Add(); } else { objectPos = transform.position; score.Subtract(); } objectScale = transform.localScale; Destroy (gameObject); Quaternion randomRotation = Quaternion.Euler(0f, 0f, Random.Range(0f, 360f)); // Instantiate the explosion where the rock is with the random rotation. also scale according to turtle scale explosion.transform.localScale = new Vector3(objectScale.x*expSizeFactor, objectScale.y*expSizeFactor, 1f); Instantiate(explosion, objectPos, randomRotation); } }