Trouble with Anim Notify

Hello!

I’m have a simple setup for an ‘interaction’ animation that’s causing me some trouble (since apparently we no longer have reliable ‘OnAnimEnd’ style delegate callbacks :mad:).

The process looks a little like this:

On a mouse click event, I set the value of bInteracting to true and player speed to 0.

bInteracting triggers the state to transition to Interacting in the animgraph.

The animgraph plays the interaction animation.

The animation plays through, and at the end triggers a notify.

The notify triggers an event in the player.

This event sets the value of bInteracting to false and player speed back to default.

bInteracting triggers the state to return from Interacting in the animgraph.

For the most part, this works - you can click to play the animation and the player stops moving. You can spam the click and there are no issues. However, it would seem if the mouse is clicked at just the right time towards the end of animation, the animation will play through to the end and the notify does not trigger, causing the player to be unable to move and stuck in that last frame of animation.

Any suggestions on how to fix or work around this? The issue is almost certainly to do with blueprint not being remotely ‘atomic’ in nature.

Character blueprint click event and event from notify:

The notify blueprint:

Thanks!

Notifies tend to not trigger if the animation weight is below 0.5 during a blend. Be it state or animation blend. See if it could be related.

Could it be that the input happens after the notify fires? Is it possible for you to use two booleans, one for the animation transition and another that blocks input from happening until the notify fires? Maybe you can reset this second boolean after transition goes out from the animation state, using a transition notify.

Thanks for your input - this does sound like it could cause a problem - but since the state shouldn’t change until after the notify has been triggered, it shouldn’t be blending yet!

Yeah, this is what I assume is happening. I could certainly add another bool in order to catch this, and will give it a go. It is quite annoying from an organisational perspective, since I’ve now got three bools (two in the BP, one in the anim BP) just to control a single on/off state.

I miss proper callbacks, this kind of silliness shouldn’t be necessary! :slight_smile:

So I got time to set this up, and unfortunately even with the second bool, it is still locking up :confused:

I think the problem is that anim notifies are genuinely unreliable, and if this is the case, and there are no callback delegates, how am I supposed to do anything with this?

I think I understand how your system works, without looking at it, so here’s a second shot. We essentially have these two steps right?

  1. Enter the interaction animation state on input.
  2. Exit when interaction animation is done
  3. Only allow interaction to happen AFTER we have exited the interaction state.

Anything in-between there should not break the state, no matter what we do right?

So, let’s start over. We are going to use two booleans here: bInteracting (false) and bFinishedInteraction (false), where () is default value.

Transition to Interacting state if bInteracting is true. Transition out of Interacting state when bFinishedInteraction is true.

So here’s a sequence:

  1. OnInput - bInteracting = True
  2. Animation enters interaction state. Animation starts playing.
  3. On notify, set bFinishedInteraction = True and bInteracting = False.
  4. Animation exits Interacting state.
  5. When fully blended out, set bInteracting = False. (use state notify for this)

In your OnInput, use a branch that says if !bInteracting and !bFinishedInteraction. This will safeguard that the user can not repeat interaction until it has fully exited the interaction state. Note that it only works if BOTH booleans are false. If one is true, it means we’re either entering or exiting the state. Only when both is back to false, do we know that we have finished one iteration of the “loop”.

I hope this will work for you. :slight_smile:

Hi Denny,

I’ve set it up more or less as you’ve described - I’ve added an additional bool ‘FinishedInteracting’ and a corresponding state notify that implements Recieved_NotifyEnd.

I’m still able to get stuck in exactly the same way because the one or both notifies just fails to trigger.

I’ve also tried using the just the state notify rather than a standard notify, but the issue is the same. Clicking within just the right interval towards the end of the animation causes it to get stuck.

Since both notify types seem to be unreliable, I really don’t know what to do.

That’s too bad. I was hoping it would solve your problem.

I don’t think I can give much more feedback than this. We’re using a very similar scenario with notifies to trigger the end of animation sequences, and this is pretty much what I do right now.

I can’t give any other feedback unless I were to look at the blueprints myself, which I guess is not an option for you?

I could upload some screenshots, but to be honest I’ve stripped it right down to the basics whilst trying to solve this issue, so I think you already have a pretty good idea what it all looks like.

I’m not convinced the problem is the blueprint itself, since it’s the notifies themselves that aren’t triggering.

Thanks for all your time though, I appreciate it!

Oh ok. By the way, are you using an ordinary animation or a montage? If it is a montage, make sure it does not have a blend out time in the asset itself.

Apart from this, I have no clue what else there could be that would stop the notify from firing. (maybe the notify can not be at the absolute end of the timeline?)

It’s just a regular animation, no montages here. I’ve tried having the notify right at the end, and bringing it forwards a little, but it’s problematic both ways :frowning:

Then I am clueless. :confused:

Edit*
Oh! I just remembered. In the transition rules you have access to the animation node! Which means you can check for the amount of time left before it should transition back.

I feel so stupid now. :stuck_out_tongue:

Inside the transition rule, to exit the interacting state, you can query the remaining time on the animation node. This should work good enough for exiting the state. This way you do not need the notify in the animation itself.

I thought I’d reply this as a possible answer in case it works, instead of being buried deep down in our discussion

I’m also having the same trouble with anim notifies. We have micropause begin/ends marked in animations, but around 1/50 times the end or the begin doesn’t happen causing bad time dilation state… Authoring extra logic to deal with this unreliability is awkward.

Actually it appears the notifies can happen twice, so for me a stack that manages time dilation might get two entries pushed from an animation, or two entries popped, when really the data is only describing one symmetrical push/pop.