Where do you assign a animation to a mapped button input?

Hey guys! So I have mapped all my button and key inputs and was looking to assign a animation to be trigger to each. I have yet to find this looking through all the example files. In the sidescroller template press spacebar/gamepad A button will start the sequence that is in the animation graph. if i wanted to assign a specific animation to be triggered by a different input how would I go about that?

Hi,

There’s probably a couple ways to set up what you are trying to do. The first is using states in the Animation Blueprint that can be entered when a specific input is pressed. In the side scroller template, in the AnimGraph, the JumpStart state will be entered (playing the anim inside) whenever the bool ‘IsInAir?’ is True. Similarly, you could set up any number of states and animations that you could fire using variables like ‘ShouldPunch?’ or ‘IsInWater?’ or whatever in their transitions. For instructions on how to pass those variables to your Animation Blueprint, take a look at this question: LINK.

Second, you could use Animation Montages to play whichever animation that you want for a specific key press. A Montage will play on a Slot node in your AnimGraph without having to have an individual state for each mapped animation. Detailed documentation on montages and how they work here: LINK.

There are situations when it makes more sense to set things up the first way and others where the second way is probably better.

Good luck!

Thanks for replying so soon.I was able to follow the setup until the last part. I have not been able to access those variables from My character blueprint in the HeroTPP_AnimBlueprint. What am I doing wrong?

Nevermind, I got it. Thanks

Nice, glad you got it sorted out.

I think many users would be grateful if you explain how you got it working, that’s how this web-app works, explain how to fix problems…