# Animator consecutive set parameter problem

I'm having a little problem with my animations transitions.

I have this diagram: http://imgur.com/Se8Ix1L

My transitions is made by updating the parameter "stateparam".

My code, changing the parameter: http://imgur.com/HlypG2L

I change stateparam to 2 and right after to 0, then my animation don't restart every frame.

But when I play, the my parameter doesn't change the animation and only change the stateparam to 0. I already debugged and it's passing in the line that change to valid transition value. But i don't know why my animation doesn't changes. If I play and change stateparam manually, it works.

If I take off the SetInteger "0", let only the valid value, the code works, but my animation keep restarting before it can finish itself.

I don't know if the parameter change it's too fast to do the transition or it's any buggy. Any help ?

Take the anim.SetInteger("stateparam", 0) from SetAnimation() method and put it in the else parts of two if statements in Update()method where you taking input.