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.
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.
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?
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.
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.