title: reseting animator in unity
body: <p>im trying to do some simple animations of a moving ball when i click on it and i want to do it in a &quot;loop&quot; what i mean is when i click the first time the ball will move from point A to point B, after that to point C and then to point A again and if i will press again it will go to point B...</p>
  <p>the problem is that after i finish the first rotation (the ball got to point A again) the ball wont go to point B no matter what.</p>
  <p>this is the animator with the states and the state parameter the condition for moving from state to state is just an int that goes up by 1 from click to click and is restarted when it gets to 5</p>
  <p><a href="https://i.stack.imgur.com/NkgQF.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>and this is the code that changes the state every time i click on it</p>
  <pre><code>  public void OnPointerDown(PointerEventData eventData)
  {
      if (relesed)
      {
          relesed = false;
          int temp = anim.GetInteger(&quot;state&quot;);
          temp++;
          anim.SetInteger(&quot;state&quot;, temp);
          if (anim.GetInteger(&quot;state&quot;) &gt;= 5)
          {
              anim.SetInteger(&quot;state&quot;, 0);
              anim.ResetTrigger(&quot;state&quot;);
          }
          print(anim.GetInteger(&quot;state&quot;));
      }
  
      meshRenderer.material.color = downColor;
      
  }
  </code></pre>