Anim Montage - how to tell if a montage section has ended ?

Hi,

I have an Anim Montage and a few sections inside of that montage, let’s say they are called A, B, C. I would like to implement a following behaviour:

  • If user pressed any key while section A and B where playing, then play section C
  • If user has NOT pressed any key, then play only section A and B but do NOT play section C

What would be the best way to handle such scenario ?

I was looking for a delegate that would be triggered when a given montage section ends but was not able to find anything like that. If I had such delegate, then I would only need to check if key was pressed or not and based on that continue / stop montage.

The only solution I can think of right now is to check section name on every tick ( GetCurrentSectionIndex() ), and as soon as it is section C - check if key was pressed and then continue or stop montage. But I don’t like it too much.

Could you please help me to come up with a more elegant solution ?

https://docs.unrealengine.com/en-US/…ies/index.html