I’m! following a tutorial, trying to get my gal to moving using the “Play Montage” node. I was told I’d get better results using a Animation BP but I don’t think I have the skill to try and set up what it’s supposed to do. I’ve been trying to find out what’s wrong to two days please help.
Hi, you also need to play the slot that your montage is using in the anim graph of the animation blueprint.
I’m not understanding. Could you explain more?
As said, your are missing the animation blueprint setup. You will need to create the Animation Blueprint and hook up the slot of the animation you want to play.
Your code looks unnecessarily complex. I am making an RPG-style game, and I can have my character play an attack animation with the code below:
I set an Action Event in project settings called MainAttack (or whatever you want). Then I call that. I run a few branches to check first if the player is already attacking. This is so that he doesn’t interrupt the attack animation to play it again. This function simply calls the character mesh, calls GetAnimInstance, then calls Montage Is Playing to see if the attack montage is playing. Then I hook up the boolean pin to the return node. So the branch checks if that montage is playing. If it isn’t, it checks if the character is falling (because I don’t want him to pause mid-air to attack). Then I use the Play Anim Montage node. Target is already self, so that’s fine. I simply dropdown and select the montage I want to play. Then I follow up with some things like deactivating the character movement and setting a IsSwinging variable. I delay for the length of the montage (off screen), and then activate the character movement and turn off the IsSwinging variable.
This works for me. Does it work for you?
If this doesn’t work, then I can only assume you don’t have an animation blueprint set up. Which is a whole different answer.