Play Montage BP, from Behavior Tree, When return Success

I am calling an Interface Function in a Behavior Tree Task that Plays a Montage on the AnimBP. I added a return float that is wired to the return of the Play Montage node, so it’s time is in the BT Task.

I tried using that value as a condition, and then summing the delta-time coming into the Tick event from the point of calling, and then doing a Finish Execute when it met the time that the Play Montage returned.

However, that’s a messy setup in a BP and it isn’t giving the desired result.

What is the correct way to call a Montage from a BT Task Blueprint?

The way I am doing it, it plays over and over, and even when in another branch of the Tree, doing locomotion for example, the Montage still plays.

Thank you

Bump… I hear crickets on this one.

Hey ,

Sorry for the wait, thank you for your patience. Could you provide some screenshots of your BT_Task, AnimBP and Behavior Tree? I would like to dig into this further and it would help greatly if I could see the flow of logic that is triggered. Any additional information may also help in my investigation.

Cheers!

Thanks for the response. I will post the screenshots tonight or early tomorrow.

Here are screentshots: This is the only way I’ve been able to make the timing on the AnimMontages work. By putting a wait and then calling stop.

Behavior Tree Sequence to Chase and Attack a mouse.

Anim Blueprint

Start Attack

Stop Attack

Hey ,

I see what you are saying now. It looks like you are setting off something multiple times along the way, but we will need to debug this further to find out why/where. Can you try switching out the way you are playing the montage to be with a direct “Play Anim Montage” node?

To answer your initial question of how to play an Animation, I have an example from my own personal “for fun” project:

In this example, a Villager is told to find, go to and then cut down a tree. The Chop animation is triggered for the Villager that is being controlled. It will only play once, then move on. I hope this helps to clarify.

Please let me know of any more progress you make and I will be happy to further assist in troubleshooting.

Hey what’s that node after event receive execute

That’s just a “set boolean” I’m using in that particular function, it’s unrelated to everything else.

I have the same issue with the task not waiting for the anim montage ends playing the animation.
Once I call the “Finish Execute” the task ends and the tree moves to “Find Tree” again (in this case) without playing the animation. How do you solve it ?

This is my last approach to it, as play anim montage outputs the length of the montage, adding a delay works, but would like to check other options.

The way that you are doing it currently is how I’d have it set up as well, so I think that’s fine. If you don’t have the delay there, it will immediately just jump to Finish Execute instead of finishing the montage. If you’re not running into any issues with the delay, then I think you are more than okay to use that particular setup in your project. Let me know if you experience any issues and I’ll be glad to look into it.