public void TakeDamage()
    {
        setHPState(false);
        hp--;
        if (hp == 0)
        {
            lives--;
            livesText.GetComponent <Text>().text =
                livesText.GetComponent <Text>().text[0] + lives.ToString();
            hp = 3;
            hp1.SetActive(true);
            hp2.SetActive(true);
            hp3.SetActive(true);
            transform.position = respawnPosition;
            LevelEndScript.animateRespawn();
        }

        if (lives == 0)
        {
            GameOver();
        }
    }