[Possible Bug] AnimBlueprint State event not firing when transitioning to Entry state

UE4 4.2.0

We’re having a situation where we want to call a Blueprint Event when entering and exiting a State. In the image above you can see that the Moving state has an Entered and Left State Event. For some reason these events do not fire when Moving transition to Idle when Idle is the entry point. All other state transitions work.

If I switch the Entry point to start at Moving, without any other changes, the events fire flawlessly.

Note that the transition to Idle do happen. The idle animations are playing. It is only the events that do not fire.

In short: Enter/Left State Events do not fire when they are defined in a non Entry state and this state transitions to an Entry state.

It is possible that I have completely misunderstood the design of State Machines. I had the impression that if a unit is currently in a state, it will move from that state to whatever next there is. It seems however that my state machine always restarts at Entry and traverses the graph when a boolean is changed…

It is also possible that my Animation Montage is resetting the state machine for some reason. (note, I only have a state machine and nodes within it, nothing else)

It seems the problem to this report had nothing to do with what I have messed with before.

If you place a Blueprint in the world, which has an Animation Blueprint connected to it, it seems the State Machine resets and traverses the graph if you change the booleans in the Details panel of the placed object.

It all works fine however, if you use an input to change the value, like pressing W or Spacebar.

Note to self: Don’t debug Blueprint behavior by using the Details panel in Simulation/Play.

Edit

8599-unintendedbehavior.jpg

As the image says, if you change values in the details panel during simulation/play, you get weird behavior. I guess this has to do with some kind of reset of the actor.

Hi ,

Based on your comments about the setup, this seems like expected behavior. If the bool “Is MOving” is tied to the moving state’s Transition Rule then it could become locked into a state. Typically we do not expose variables that are involved with animations, as they are altered dynamically by input changes from controllers/environments.

if you change values in the details panel during simulation/play, you get weird behavior

Animation BP values are not really designed to be set manually like that when already playing. Is there a reason you would need to set it in the details panel at runtime or was this found during testing?

Cheers!

Hi , thank you for your reply.

I noticed I did not mention that I am driving the Animation Blueprint with a Character Blueprint, which I place in the world. All booleans in the Animation Blueprint is driven by the Character Blueprint.

The reason why I went with the details panel is because I wanted to test all the transitions on the character after placement, there is no controller yet to drive the character as it will be an enemy character. I thought it would be no difference if I manually clicked the boolean value rather than having an input listen to a keypress and then doing the same thing.

To clarify there was no boolean logical faults in the state machine as it works as intended when using inputs to drive the values. If you change booleans in the details panel however, on a placed object, the state machine will restart and traverse from the entry point again.

I have used the details panel before, in some of my personal projects, to do simple things like increasing the number of inventory items a character has access to. I didn’t have any problems then, so I thought I could do the same here.

Hey ,

If you change booleans in the details
panel however, on a placed object, the
state machine will restart and
traverse from the entry point again. I
have used the details panel before, in
some of my personal projects, to do
simple things like increasing the
number of inventory items a character
has access to. I didn’t have any
problems then, so I thought I could do
the same here.

That reset is caused by the way the logic of execution flows in the Animation BP. It will happen because when switched on from off, the BP is being to to restart that execution again.

Exposing variables to be altered for easier setting/testing is perfectly acceptable to do with the editor. You may just see weird results from animations like what you have seen because checking on the bool in the details causes it to be hard locked to that setting. So if you set one up to say that IsFalling is always true, then the character would become stuck in a “falling” state even with new input that would override a normal setting.

Let me know if this helps.

Thank you , I now have a better understanding of how things work in the background.