Animation that suddenly cuts off

Hello/Good morning/Good evening,

I currently have an issue with my Animation Blueprint. Basically, in my State Machine, I have the beginning state “Light_On” and the ending state “Light_Off”, but the ending animation simply does not play.

Does anyone know how to fix this issue or have any idea what could be causing it?

Sorry for my approximate English, I’m not a native English speaker.

The issue is that you’re asking your false state of ‘Flashlight Equipped’ to play animations from the ‘Light’ state machine, but you’re also telling your animations to switch (on Boolean) to ‘Locomotion 1’ when ‘Flashlight Equipped’ is false.

“There’s more than one way to skin a cat,” so whatever works is generally okay, but you may consider adding all of your states to a single state machine for simplicity, as a side note.

Essentially, either combine your state machines, and get rid of the ‘Blend Poses By Bool’, or else use a different Boolean for that transition.

So my problem is coming from the Boolean?

Hey there,

Your problem is caused by conflicting transition rules. Try to increase the transition “False blend time” from 0.1 to 0.9 and check the results. The reason stated before is that your setup is not allowing enough time for the “flashlight off” animation to play, because the False Blend Time is very fast at 0.1 sec. Either adjust the time or change the transition rules.

I tested it, and it doesn’t change anything. The Light_Off animation is not playing correctly. I checked the transition carefully; it does trigger properly, and the animation also plays, but extremely, extremely, extremely quickly. In fact, after looking closely, it doesn’t even play for its full duration, it only lasts about 0.03 seconds out of the 3 seconds.

However, Light_On and Light (Idle) work perfectly fine. The issue only occurs with the exit transition.

So, I can’t see what’s contained in you ‘Locomotion 1’ state machine, but from your screenshots, it appears you’re attempting to play animation transitions from your ‘Light’ state machine. If I understand that correctly, once ‘Flashlight Equipped’ becomes False, you won’t see the transitions played from ‘Light’ because your ‘Blend Poses by Bool’ will subsequently only allow the passing of animations contained within the ‘Locomotion 1’ state machine.

As @L.F.A mentioned, you could adjust the blend time to allow the animation to complete, but you’d just have to eyeball the value you need. Or again, use a different Boolean variable on your ‘Blend Poses by Bool’ node, which admittedly may require modifying your logic somewhere.

Another option is to simply keep all of your state machine states in the same state machine, if possible. It can sometimes be over-kill to have multiple state machines for locomotion; so, I suspect you may be doing something unnecessary, if not unique.

FYI: I too have multiple state machines, but my ‘Locomotion’ is referenced in the ‘Main States’, and never referenced directly, on its own by anything else so it can never overwrite ‘Main States.’

Consider checking out a tutorial online for more details.

In Locomotion 1

, the content is exactly the same as in the classic Locomotion. It’s just a duplicate.

As for using a different boolean between the animation and the Blend Poses by Bool node, I already tried that. It didn’t change anything.

However, I saved the pose to make it easier to identify.

Here are a few more screenshots to help visualize the issue more clearly.

As you’ve (seemingly) created your ABP from scratch instead of using the ‘BP_ThirdPersonCharacter’ template, I’ll have to assume your setup is sufficient. However, your screenshots reveal the use of several unconventional practices. So, I’d like to confirm some basics:

A) Is the animation, which doesn’t play, actually a part of your state machine? Is it inside your Walk state or your Idle state or another state near them? Or is it an ‘Animation Montage’ (which is called by a ‘Play…’ node inside your character BP?

If it is an ‘Animation Sequence’, then what has been discussed thus far should work.

If it is an 'Animation Montage’, then you need a montage (default) slot to play it (with greater priority) over your state machine.

An 'Animation Montage’ is typically used for one-time actions like attacks, equipping/unequipping items/weapons, and etc.

B) If the animation (sequence) is in your state machine and is at all tied or subject to your walking state, you’ll likely do well to keep with convention by using ‘Should Move’ for ‘Idle’ and ‘Walk’ transitions. The grey area between speed greater than 50 and less than 10 may be causing a delay, somehow impacting your animation.

There may be possibilities, which I wouldn’t think to consider that a tutorial might go over by default.

Another question, who is assisting you on your learning? Are you following a tutorial to the letter, or making code changes on your own?

Light On / Light Idle / Light Off are inside the State Machine and they are not Animation Montages.

Basically, this is an animation that needs to be activated. When we press F, the flashlight turns on, and when the flashlight is activated, it sets the “Lighting” Boolean variable in the Character Blueprint to true.

This “Lighting” variable is then called in the ABP Event Graph:
Cast to BP Character → Get Lighting → Set Flashlight Equipped

The Walk/Idle animations are working correctly. The only issue is with the Light On / Light Idle / Light Off animations. They only affect the upper body when the “Lighting” state is activated.

The Light On animation and the Light Idle animation are working properly, and the transition between them is also functioning correctly.

The problem seems to be with the Light Off animation (the exit animation). It either does not play at all or it plays so quickly that it is almost impossible to notice.

I’m mainly learning through tutorials, but I’m not following them 100% word for word. I use them as a base and then I adapt the systems to fit my own project.

For this flashlight system, I built it myself by modifying the logic to match what I need. I’ve only been working with Unreal for around 4–5 years, so I’m still learning and improving my workflow. I may sometimes use unconventional approaches or miss some best practices, which is why I’m asking for advice and trying to understand the proper way to do things.

Please re-read my first post: You cannot receive animations from your ‘Light’ state machine while your ‘Flashlight Equipped’ Boolean is False. That is your setup–it is working the way you’ve coded it to. You need a different Boolean variable to control your Blend than the one controlling your state transition. You will only see animations from ‘Light’ while ‘Flashlight Equipped’ is True, according to what you’ve coded.

Understood, no problem at all. If you’re aiming for horror / survival, I recall seeing complete games from tutorial series with game mechanics similar to what you’re showing. Let me know if you need some references for other tutorials.

Best of luck!

I actually tried using a separate Boolean just for the animation and the per-bone blend, if that’s what you meant. Unfortunately, it didn’t change anything.

I think I’ll come back to this later. It’s only a minor bug after all not being able to see the flashlight unequip animation isn’t a big deal in the end.

Thanks anyway for taking the time to help, I really appreciate it.

Yeah, it’s actually a horror point-and-click game. The problem is that there aren’t many point-and-click tutorials out there, and even fewer that seem to cover the issue I’m running into.

Understood; but as I mentioned before, one-time actions like attacks, equipping/unequipping items/weapons, and etc. are best done with ‘Animation Montages’.

Draw & Sheathe Tutorial - Unreal Engine 5.2