"Animation of ____ is finished" not working?

Hello, I’m currently trying to make a state-machine for my enemy AI, and I would like one of the states to finish once the animation finishes using the “Animation of is finished” condition, though when using this, the enemy freezes instead of being set to the next state, only moving again when another condition for another state is manually done.

Here are my events:


As a follow up, I’ve also been trying to figure out how I can make it so that the enemy will finish the current state first before changing to the next (I.E. when the enemy punches, I’d like the whole state to finish first regardless if it is now far enough for another state to be active.)

Which state is this happening for?

Also, you’re not properly using a state-machine here. To use one (and I’d strongly suggest you refactor your events to do) the first event for a state should have the condition that checks what state it’s in while the state change is done as a subevent of that first event:

In the snip above, the distance test is not in any state. It can happen any time.

Effectively using states controls what can happen in a specific state. Here’s an example of states

image

and this is an example of how the state is changed only events within that state:


By doing it this way, there’s no confusion to when a state can change, or what state it can change to.

Hello! Extremely late update as it took me a while to try and understand how the state machine is implemented. I’m not sure if I’m doing it correctly now, but as for which state its happening to, it would be both the Attack State 1 and Ranged Attack State 1.


Here is the updated Attack State 1, but once the punch wind-up animation finishes it freezes there instead of continuing onto the actual punch animation.

As for the state machine issue, I’ve reworked my conditions to look like this now.


I still haven’t completely gotten the point but from what I understood, now the attack and ranged attack states can only happen if the current state is the walking state.

The “Range Attack State 1” looks to be because of the trigger once. All the subevents will be evaluated once, and then that’s it; the animation finished check won’t be done again, and if the distance text is not within range the first time round then horriganState won’t get changed.

As for the “Attack State 1”, it’s hard to tell what’s going on. It sounds suspiciously like the animation is getting changed somewhere else. One way to check this is to put a “Debug log to console” action just before you change the animation to “Punch Wind Up Test”. For the message, use the current animation name of Horrigan, and then run the game in debug mode.