Hello! I am new to Unity and have been following many tutorials from YouTube and learning as I go. I recently added a Health Potion to my 2D game and it works as expected, but now whenever my player is damaged the animation I had no longer plays. (When my player got damaged he flashed red). I’m not sure why it isn’t playing anymore. The animation is called ‘Player_Damaged’ and is set to legacy. I am getting no errors but the animation just isn’t playing like it used to. If anyone could help me that would be great! Thank you.
I have referenced it in my code here:
public void Damage(int dmg){
currentHP -= dmg;
gameObject.GetComponent<Animation>().Play ("Player_Damaged");
}