public void PlayerDead() { GetComponent <CapsuleCollider>().isTrigger = true; _rbPlayer.useGravity = false; _bugAnimContoller.Dying(true); AudioSource.PlayClipAtPoint(DeathClip, transform.position); Camera.main.GetComponent <CameraFollow>().enabled = false; // just to make sure to disable this script so unity will not thrown any exception _uiController.GameOver(); destroyPlayer(); }