# Reseting animation

I'm writing little fps game in Unity 5.3.5. So, I've got my gun object and two animations, idle and shot. I've got transition from idle to shot with trigger condition and "Has Exit Time" unchecked. In the idle animation after few seconds gun do some cowboy-style spinning. Problem is, when I fire my trigger during the spin, shot animation starts exactly from point where idle animation was interrupted, which causes shooting to the sky or to the ground.

I know i can make no transitions and do everything from code, and reset every animation to start position before playing another, but is this elegant way to do such a thing? Are there any good practices someone could share with me?

• Do you use Blend Trees? By the way, it's very uncommon for FPS games to have the fire direction affected by the rotation of the weapon model. – Philipp Aug 18 '16 at 11:00
• No, I'm not using Blend Trees. Actually never heard of them, gonna check them out. direction of bullet is not affected, it works fine, only weapon animation shows that i'm shooting myself :P Do you think Blend Trees are something that could help in my situation? – dargemir Aug 18 '16 at 11:08
• Does your shoot animation start by having the gun pointing, or lifting the arm up in preparation to shoot? – Peter Morris Aug 18 '16 at 11:19
• I don't have an arm, just gun. Every animation's first and last frame brings model to situation, where all transform parameters are set to 0. For example, when i shot gun is in it's default position, after 0.1 sec barrel jumps up a bit, and then after 0.9 sec if comes back to the default position. For now all animations are just one-dimension rotations. The problem is, when I interrupt one animation, the "default" state is no more all 0's. Maybe problem is that i made my animations in unity, not in my modeling program. – dargemir Aug 18 '16 at 11:30

Reduce transition duration of the intended transition.