- Edited
Hi! I got a working attack combo system for my action RPG project and to solve the problem of input delays (so players don't spam attack to quickly skip through the last attacks), I learned to use call method tracks on the animation player timeline. Like so:
It's working well, the ReadyForAttack() function has a var called "Ready" that sets to true that allows for additional input to the next attack when it's on that frame in the timeline, it also has a gotoidle() function that puts the player back into idle state if they're not gonna attack anymore. It's this way because I am using one timeline for one directional five hit combo to save up some organization hell.
But as you can see in the image, I also have a function key'd AttackAgain() which also sets the Ready var to false so that the player can't spam the next frame. This is on the first frame of every combo attack.
Why do I have this?
Because if I don't, then the gotoidle() function that I have that's key'd a few milliseconds before the keyframe of the next attack will continue calling its function and I won't be able to move to the next combo. While I will probably be able to have a successful input towards the 2nd attack, it only does so a split second frame before it gets called to idle again. The inputs and states I have are in a _delta physics process, while the gotoidle is its own function, so I figured the problem then is in the animationplayer itself. (If it helps I used seek() to get to the next frame, if that changes anything.)
The workaround I did is the AttackAgain() function, however I don't want to have this, as this means that for every character I do this for I have to manually set those function keys which I simply want to save time and effect from.
Q: (For lack of better word) Is there a way to "cut" the frames of a function in the animation player's call method track so that it only calls it until a certain keyframe or at least once?