using a coroutine to buffer fighting game input?
I've been trying many methods to recreate fighting game inputs in unity, currently attempting to use event listeners to detect sequences of button presses, but more research on coroutines has had me reconsidering. For those who don't know, a fighting game allows for a wide array of moves by allowing players to quickly input a series of button inputs, for example, Ryu's shoryuken is performed by inputting down, down+forward,forward and punch in under a second. In my efforts to replicate this, I was inspired by the function of ][1] keyboards, which use chording, fighting game inputs are essentially all sequences of button chords over a span of time. The initial idea was to have a listener corresponding to each sequence of inputs and to have it fire when an array containing the sequence was iterated through. It sorta worked, but I couldn't figure out how to include a buffer.
My new idea is to have a coroutine waitforXframes before "releasing" the input and thus resetting the listener. However, there is no such waitforXframes method in the docs. I have some ideas, but its always good to poll a group of peers. What solutions do you guys suggest?
Your answer
Follow this Question
Related Questions
Click two buttons at the same time 0 Answers
Trying to get user input while yield return new waitforseconds is running in a coroutine 1 Answer
Game Kit Controller - no input 0 Answers
Animation not occuring instant,Survival Shooter Walking animation not instant... 0 Answers
How do I override my touch.phase? 1 Answer