public void Die() { Debug.Log(gameObject.name + " is dead"); alive = false; Vector2 vel = rb.velocity; ShootController.CancelShooting(); GameObject crashingPlayer = Instantiate(CrashingPlayer, transform.position, Quaternion.Euler(0, 0, gameObject.transform.eulerAngles.z)); Instantiate(DeathExplosion, transform.position, Quaternion.Euler(0, 0, gameObject.transform.eulerAngles.z)); crashingPlayer.GetComponent <Rigidbody2D>().velocity = vel; //--check if the player had a wheel showing - if not, hide on crashingPlayer too if (!DetachableWheelScript.hasWheel) { crashingPlayer.GetComponent <CrashingScript>().RemoveWheel(); } gameObject.SetActive(false); //--show the scoreboard - or start another round GameController.EndRoundCountdown(); }