Help me reset the chain slash or swing attack

var swingRate = 0.35;
var swingRate2 = 0.45;
var swingRate3 = 0.5;
var comboDelay = 0.7;

private var nextSwing = 0.0;
private var swingCounter = 0;
private var timer : float = 0.0;
private var startTimer: boolean;
private var swingTimeOut : float = 3;

function Update ()
{

     if (Time.time > nextSwing)
		{

         switch(swingCounter)
			{

                case 0:
				SendMessage ("Swing1");

                    
					nextSwing = Time.time + swingRate;
					
					break;

                case 1:
				SendMessage ("Swing2");

					
                    nextSwing = Time.time + swingRate2;
					
                    break;

                case 2:
				SendMessage ("Swing3");

                    nextSwing = Time.time + swingRate3 + comboDelay;
                    break;

            }

			swingCounter ++;
			if(swingCounter++)
			{
				startTimer = true;
				if(true)
				{
					timer += Time.deltaTime;
					if(nextSwing > timer)
					{
						swingCounter ++;
					}
					else
					{
						swingCounter = 0;
						timer = 0.0;
					}
				}
			if(swingCounter == 3)
			{
				swingCounter = 0;

			}

		}

}

hi could anyone please help me with this code…

what i want is to reset the chain attack if the player stop on the 1st or on the 2nd chain attack… example: if the player stop for certain 1sec or less on the 2nd chain attack, the player will start again on the 1st attack instead continuing on the 3rd chain attack. since each have different animation.

best example for this is like in the tekken 6 doing combo 3 punches by pressing “square+square+square”

hope you get the point of what i mean

thanks more power on unity!! =D

I’m to figure out the same thing, if I figure it out I’ll post here.

thats great!!

ive tried all method and technique i know but none is working :cry:

there is a chance that i almost got it right but my problem is the timer wont reset… maybe or i dont know, but the code is working fine and it has no error

Hi reigner,

Did you guys manage to figure out this combo system to reset back to idle when the player does not continue to press buttons ?