firebar goes down and stops

Hi,
I’ve made a code in which I want a line to change the width if I fly… in this case it is called jump. I’ve made this with an animation. The fire bar has an animation in which the width changes to be smaller, like a health bar… here’s the code:

if(…){

firebar.animation.Play("firebardown);

}

if(…){

firebar.animation.Stop("firebardown);

}

but now I’ve got the problem that the animation starts new if I jump. How can I change it… I want that the width of the fire bar gets smaller… I stop jumping, then the animations stops… then I start jumping and the animations goes on and doesn’t start new like it does in my code… please help. If some people don’t understand this description then just ask me for a description that is more detail.

SRY for my english…

AnimationState.speed = 0 should stop an animation, then setting AnimationState.speed = 1 should resume it.

So I think you can do firebar.animation.speed = 0 to stop, and firebar.animation.speed = 1 to resume.

I’m not an expert on the Unity animation system, but this is what it looks like you should try.