The gun jams (Animation)

I have a problem with the recoil animations of shots.
I first made a 30 frame animation, but it was too slow.
Then I kept increasing the “Rate Scale” but when the value is greater than 8 the gun barrel stops moving.
So then I made an animation with only 5 frames but it’s still slow even if I set the “Rate Scale to 2”.

rateScale

As you can see in this video if I shoot slowly it works, but if I shoot quickly it doesn’t move.

Although even this way the animation doesn’t play completely. It should be like this.

I’m controlling it using a state machine.

SM

Only one boolean variable controls it. (Is Shooting)

How can I fix this?
Thank you so much!!

Probably because it resets the animation every time you shoot so it doesn’t have any time to play while you keep spamming. If that’s the case, you can add a cooldown by only enabling shooting again once the animation is complete. It would be easier if you were using anim montages, but since you’re using states, you can calculate this in your event graph inside your animation blueprint.

1 Like

Sorry… I forgot to say this.
I have an event on the animation timeline.
When it is executed the the boolean variable takes false value… just when the animation ends.
It should be reproduced completely.

I did a test using a delay… it starts to fail when the time is less than 0.2 seconds.

Thank you so much

I’m not entirely sure, but could you try increasing the frame rate of the original animation?

I did it. But I had the same problem (more o less).

I meant the original animation that you import to your project. Using a 3D editor

Yes, me too. I made the 30 frame animation in Blender in the first place… But no problem.
I’ve done it again, so you can see, the problem is the same.

Blender:

Anim Instance:

Sorry if I’m unable to communicate properly :rofl: Like I said, I’m not sure if that’ll solve the issue but personally I would try adjusting the animation to be at 60 frames per second from Blender and reimporting. From the video you’ve sent, it still seems to be at 30

With 60 frames it’s the same problem.
In fact, now I think that the number of frames is not the problem.
It always fails when the boolean variable changes value before 0.2 seconds… even if the animation plays slowly.
It must be something else causing the problem.

I think I found the problem.
The transitions had a value of 0.2 seconds…

I set it to zero and it doesn’t fail anymore.
I’m going to try it in GamePlay to see how it behaves.

Yes, that was the problem!! Now it works perfectly!!

Thank you very much! Without your help I would not have found the real problem so quickly.
(Only three hours :rofl: :rofl: :rofl: It’s quite an achievement)

Thank you so much!!!

1 Like