Hi…
i´m looking for a way to script a sequence of punchs (a combo)… each combo has a number ID…
for instance:
If player presses punch button, then player will perform punch 1…
if player presses again the same button, then player will perform punch 2…
if player presses again the same button, then player will perform punch 3…
and so…
i have created a var called “sequenceNum” that increases each time you press punch button…:
if (Input.GetButton("punch") sequenceNum == 0){
punch 1
sequenceNum = 1;
}
else if (Input.GetButton("punch") sequenceNum == 1){
punch 2
sequenceNum = 2;
}
else if (Input.GetButton("punch") sequenceNum == 2){
punch 3
sequenceNum = 3;
}
that works… but i´m looking for a way that the sequence returns to 0 if you have stopped pressing the punch button for a certain time…
For example:
I press punch button, … player performs a punch. i have 0.5 seconds to press again punch button to increase sequence number and get the next punch, else the sequence counter will return to zero …
Thank you!