Fixed bug of life hearts destroying out of order after scene restart

This commit is contained in:
Gregory Campbell
2020-07-11 17:12:28 -04:00
parent a7c5d2bacf
commit dd8a5af89d
+7 -1
View File
@@ -68,7 +68,13 @@ public class PlayerScript : MonoBehaviour
{
life--;
Destroy(GameObject.FindWithTag("Life"));
if(life > 0)
{
Destroy(GameObject.Find("Life ("+life+")"));
} else {
Destroy(GameObject.Find("Life"));
}
}
}