How can I assign an animation to button press in UE4?

I’m currently playing around with the builtin Top-Down blueprint and I’ve managed to switch out the HeroTPP model, skeleton and animations for my own. Works wonderfully.

Now I want to shoot an animation when I press the button “R”. Currently the blueprint is identical to the one that already comes with UE4 meaning I can’t use the two answers I’ve found on here as they don’t show the full blueprint which means I’m SOL trying to find out how they set everything up.

I was wondering how to do something like this. I am working with c++ code so it may be different with blueprints but based on some other responses I looked at I think you may have to use an “Animation Montage”. I wasn’t able to figure it out myself so I’m sorry that I can’t provide any more assistance but I would look into Animation Montages and see if that sheds any light on the situation.

Hey! I actually got linked to the Unreal Engine youtube where they discussed AnimationMontage. However despite doing it the animation just does not fire. It just goes to fail in the branch.

Can I incorporate C++ into this? I figure an if statement with a keyevent would be enough for this (coming from java at least).

Hey,

Does this thread help at all?

-W

Got it working. Thank you!

How would I go about stopping character movement while animation runs? Your YT channel says to dedicate the animation to only upperbody but as my animation uses the full body to do the animation I would much rather just stop the character in its tracks until animation finishes.

Why was this down voted? It answered the question! If this doesn’t help you it doesn’t mean it’s a bad answer.