- Home /
Question by
metalrave · May 03, 2021 at 06:26 PM ·
animationanimatoranimator controlleranimationsanimationclip
How to interrupt and replay an animation?
Hey guys, I'm stuck on this fps game that I'm making. I've set up a rifle and a gun script, and a Rigid body FPS Controller from Unity Standard Assets.
Basically I want to apply a simple gun recoil animation, which I have created in unity itself. The problem is that I want to basically keeping the animation non-looping, play the animation whenever the mouse button is pressed, and, in case the button is pressed while the animation is playing, I want to interrupt the playing animation and replay it from the start.
I'd be very grateful If anyone could help me out here
Comment