Blendspace Animation doesn't work after some "Play Animation" nodes.

Hey guys! I’m following this playlist to create a AI animal (Letting The Animal Eat | Hunger System | Part 3 Of Creating An Animal AI In Unreal Engine 4 - YouTube). I have set up the animal’s walking around, rest and hunger nodes, since this is what I need, I don’t need to attack or be attack by the animal, so no extra damage nodes/animations necessary.

This setup allows for the animal to roam around freely, and run away when it hears me close enough… Also it has 2 values (hunger and rest) that depcrete and regain during the time.

The thing is, I noticed that everytime he finishes the resting or eating sequence, he stands up and keeps walking without animation… literally just floating around. His animation bricks out, freezes and when he roams again he doesnt do the animation in for walking/running in the blendspace that was setup. video examples and bluepritns below.

note: Some of the values and velocities for delays and speed either on the time of eating,resting and values of drain/gain, and what not are ajusted to a level i have here and still on testing… but that system is working as intented, because he does the animations of eating/resting, at the proper times… the issue happens when he finishes those sequences of rest/eat that go like: >> “stop immediately” >> “play animation” >> “stop animation” >> but when it’s time to put the original blendspace animation back to work… since he stopped the previous “play animation”, he fails and bricks out and starts floating around.

This also happens, in-between states— meaning that if my character walks close to the deer when he’s resting or eating, he runs away… but doesnt change animation… so he basically starts running away while sitting down… and it just looks epic hahaha, but not what is intended.

Even tried working out some nodes inside the animation blueprint and state machines, but it’s really confusing to implement with this system of rest/eat, which I actually like…

Any help would be appreciated rly!
Thank you for your time!

These are my blueprints:











and a clip with the issue:

When you use “Play animation” directly on a skeletal mesh component you change the animation mode and essentially turn off your animation blueprint.

If you wish to play simple animations and not have to deal with building a state-machine etc in your animation blueprint I suggest reading up on animation montages, which can be played through a slot in your anim-bp.

1 Like

Hey @sportbil,
Thanks for your reply, I will take a look at animation montages and come back with feedback!

Thank you, cheers!

I can’t spot it in your screenshots, so I assume this to be the cause:
I think “Play Animation” replaces the Animation Class (your Animation Blueproint) with the animation. But if you just call “stop animation”, it will do exactly that: stop the animation. It will however not re-add your animation blueprint. This is why the mesh is afterwards in its refpose. To get your animation blueprint back in you have to add it yourself.

I can’t be entirely sure though, as you don’t show what your “stop animation” function actually does.

A more appropriate way of handling that would be to handle the states(moving, walking, lying down, etc.) in your animation blueprint, and handle one-off animations(standing up, laying down, etc.) as AnimMontages.

I hope this helps!

1 Like

Thank you for your input!

Here’s is what the stop animation node does:

And I will take a look at this!

Thank you for your time!