How to stop an animation

I have a script that alows me to fire
Void bla bla ()
{
if ( input … )
(
Fire();
Anim.setbool (“firing”, true)
)
}

But the problem is it doesnt stop after i realised my shooting button i also tryd anim.settriger but that doesnt work to how can i stop the animation after i done firing ?
Sorryfor not puting this in scrip edit iam on my phone ATM

You can get the Animator component, and then disable it (set .enabled=false), or set .speed=0.

Or, you could set a trigger, which will work if you set up a transition on your animator state that goes to whatever you consider “stopped.”

1 Like