My character animation keeps looping after single input press. I want it to play only once. How to?

I’ve set my an animation to play when I press X, but after that it keeps looping over and over, some times it stops if I press X a few more times, this is my current setup on animation blueprint, I’m guessing this is where the problem is??

And the part of te state maching where the animation is.

45824-3.jpg

the animation is about 1 second long and I What I want is the full animation to play once when the button is pressed once, whether or not it has been released should be of of no significance.

So how can I go about doing this?

And when the full animation (1second) plays once, it should reset so I can press the button again to play it again.

You’re probably better off using animation montages for doing attack animations. There’s a handy dandy guide here: - YouTube

What you’ve got going on now, is that in your state machine, you’re having a transition into the attacking animation state when the variable is set. Then it stays in that state looping for as long as the variable changes again. The do once thing calling the custom event would run whatever you put after the event once (which would in theory work for doing some damage or something once every time you trigger it again) [Although your do once starts as closed, so it would do nothing the first time and then something after that every time] Now in theory, you could set up an AnimNotify to the end of your attack animation and use that to change your IsXAttacking back to false, but I don’t think it’s the best idea to do it that way, especially if the graphs start getting more and more complex.

I’ve setup with animation montage, now it’s stopped looping but the problem is the animation also stops playing the moment the button is released. the animation is about 1 second long and I What I want is the full animation to play once when the button is pressed once, but it stops playing the moment the button is released. Any idea on how I can do this?

Can you show how you set it all up?

Okay figured that out :), now the animation montage no longer stops playing when the button is released, I just did something wrong. Only one last problem left to solve.

When X is pressed once the animation full plays, but when X is pressed rapidly the animation is starts to jitter as if it’s trying to fire the input again. How do I get it to play normally even when X is being pressed rapidly?

Here’s a very short video of what’s going on right now - YouTube

And my setup, I am not using the state machine ATM, but it has the same problem aswell.

I use get current montage, compare that with an empty montage and use a branch to make sure that I can only play a montage if there isn’t one playing now.

Ookay, I’ve made everything… but 1. How do I get this thingie in the middle?

Just drag out the blue dot from the one on the left and type == for getting the “equal to” node

Well, I did all that, still no difference so not sure if I did it right or if there is more to do?? sorry I’m a total noob at this.

Haha, Figured it out. I was putting it in the get current montage in the anim blue print. Move it to the character blueprint instead and everything is work just fine now.

This has actually been bugging me for months but now it’s solved, Thank you very much for the help sir.