Switching Between SpriteSheets

Hi I am very new to unity, and I manage to survive some tutorial and coding…:smile:

Now, i am having a question and problem in my head.

So basically i am making this 2D platform game which it has a basic/normal SpriteSheet, it has an idle, jump, walking, and running animation.

I manage to get everything working properly.

Heres the question, I wanted to make a script, so when the “Player” is damaged, I want it to switch to another SpriteSheet I made that has its body damaged, (Like it has blood on its hands, or its arms are falling off).

So, instead of having a life or health bar, I want the “Player” to have battle scars to indicate that the player is in fact dying because of obstacles, and traps.

And this is my final project for college, so I kind of panicking a bit, since my lecturer also didn’t taught us a lot, so we have to study and find everything on our own.

So, how do i basically begin to script? I am totally confuse where to begin and is it even possible to switch between SpriteSheets?

This is my current SpriteAnimation Script

Thank you.

bump

I don’t know what is SpriteAnimator, but the texture used is likely referenced in there. Just look it up, either open that script or see what the Component Inspector shows. Also, please use tag, the code it pain to read like this.