Download

state transition delay

Hi there!

In my state graph I’ve got several nodes that have the same condition for transition
state_graph.PNG

The condition looks like this
transition_rule.PNG

Basically I wanted to achieve a flow where animations played one after another.
However when the condition is activated it almost immediately moves towards the latest animation in the sequence (Idle_Walk -> Draw_Sword -> Sword_Idle_Walk).
It moves towards Draw_Sword node but immediately leaves it and moves towards Sword_Idle_Walk. It seems to have no time to show animation even.

How to add delay between transitions?

You could use “Time remaining (ratio)” < 0.1 instead of the second “IsEquipped with Sword” so it may only leave the “draw sword state” if the animation that’s put in there played at least 0.9 of the anim.

Cool. Thanks!

But what is the best practice for such cases? Creating blendspaces?

P.S in may 0.5 ratio was enough

Blendspaces are great if you would blend (or mix over a longer period of time) some looping anims via one or more linear values. Like direction and speed. If you would switch some states (once) you could even make use of anim-montages and slots. Just connect your IdleWalk directly with your Sword_IdleWalk based on your IsEquipped bool. Add a slot in your animgraph between your state machine and the final anim pose (or a cache if you split up further). To get your “equip” and “unequip” anims of the previous “Draw sword” state you could fire some “Montage play” afterwards in the eventgraph of your anim bp if that “IsEquipped” bool changes. Just add the anim of Draw sword into a anim-montage and assign the same slot. You could even add some anim notifies in that anim-montage like “EquippedSwordNotify” that could be forwarded to your character BP (to attach the sword to your hand or to switch the sockets, …).

It just plays half of the anim in that case… which might be ok because there’s some default time value for blending between those transitions.