title: Stopping animation (attack) to loop itself when play
body: <p>In unity we know that when animation plays it loops itself (replays) and that is good for movement animation(walk ,run,jump) .</p>
  
  <p>But In my case it is causing a weird effect as shown in pic:</p>
  
  <p><a href="https://i.stack.imgur.com/u767v.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u767v.gif" alt="errorloop"></a></p>
  
  <p>Now when I click and hold the button what I want is that <strong><code>the character should take his arm up and then keep it</code></strong> unlike taking it again and again till I do not release my finger from button.</p>
  
  <p>Bcoz its an <strong>attack animation</strong> thats why I don't want it !</p>
  
  <p>the attack script and animation call is as follows:</p>
  
  <pre><code>public void LaserAttack(){
          isAttacking = true;
          if (robotLeft == true&amp;&amp;isLaserLeft==false) {
  
              //Debug.Log (firep.position.x);
  
              //Instantiate (leftLaser, firep.position*1.29f, Quaternion.identity);
  
              StartCoroutine( DelayMethodLeftInstantiate());
  
          } 
  
          if (robotRight == true&amp;&amp;isLaserLeft==false) {
  
              StartCoroutine(  DelayMethodRightInstantiate());
  
              //Instantiate (RightLaser, firep.position, Quaternion.identity);
          }
          anim.SetBool ("isAttack", isAttacking);
          isLaserLeft = true;
  
      }
  
      public void LaserAttackEnd(){
          isAttacking = false;
  
          anim.SetBool ("isAttack", isAttacking);
          isLaserLeft = false;
  }
  </code></pre>
  
  <p>I am calling attack animation in touch button as follows !
  <a href="https://i.stack.imgur.com/BD2Ri.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BD2Ri.png" alt="enter image description here"></a></p>
  
  <p>Now how to achieve it ?</p>