How to make combo attack in mecanim with gui textures and touch (c#)

Hi all,

II’m having a lot of problems when launching the second attack combo … the idea is that when you make the first attack if it is not finished and you press the button that launches the second if not do nothing.

No efficient solution:

foreach ( Touch touch in Input.touches){
    
				
    if (touch.phase == TouchPhase.Began)
    {
        if(buttonA.HitTest(touch.position )){
			Debug.Log ("primer toque");
        	anim.SetBool("Attack", true);
			
    	}
	}
	if (touch.phase == TouchPhase.Ended){
			anim.SetBool("Attack", false);
	}
			
			
	if (currentExitTime >= 0.45f){
				Debug.Log ("voy a combar");
		if (anim.GetBool("Attack")) {
					Debug.Log ("voy a combar2");
			 if (touch.phase == TouchPhase.Began)
   			 {
		
      		 	if(buttonA.HitTest(touch.position )){
					Debug.Log("2 toque");				
					
					anim.SetBool("Attack1", true);
					
    			}
			 }
			 if (touch.phase == TouchPhase.Ended){
				anim.SetBool("Attack1", false);
			 }
		
	}
		
		}
	if(currentBaseState.nameHash == attack01State){
		if (!anim.IsInTransition(0)){
			Debug.Log("ataque 1 NO");
			anim.SetBool("Attack",false);
			anim.SetBool("Attack1",false);
		}
				
	}
	if (currentBaseState.nameHash == attack02State){
		if (!anim.IsInTransition(0)){
			Debug.Log("ataque 2 NO");
			anim.SetBool("Attack1",false);
	
		}
			}
	if (currentBaseState.nameHash == runState){
	
		if (touch.phase == TouchPhase.Began)
    	{
       		 if(buttonA.HitTest(touch.position )){
				Debug.Log ("primer toque");
        	 	anim.SetBool("Attack", true);
			
    		}
		}
		if (touch.phase == TouchPhase.Ended){
			anim.SetBool("Attack", false);
		}
	}
	}

Im trying a lot of combinations including currentExitTime = currentTransition.normalizedTime; and more things but I cant get a optim solution. This is because guitexture not unlike a touch or other.

Thx and regards.

This was nearly one of my problems in my game. So I tried using the Legacy Animation instead of Mecanim and I achieved what I desired. I had problems in triggering other state while another state is playing.

So… There isnt a way to make that with mecanim?? wtf???

With NGUI its possilbe??

thx.

There’s must be a way with Mecanim, of course. I’m a beginner too just so you know. Wait for the experts answers here. :smile:

Nobody had trying something similar?

i’m searching a simillar thing like this, but i don’t know how to make it, and… can you help me?? i need make a script that a animation in mecanim starts [activate bool] when i press a gui button