Animation keeps repeating

Right now I have a basic melee script with animations, I have a stabbing animation (position animation) that works perfectly and a wacking (rotation animation) that just keeps repeating endlessly, They both use the same script:

private void Update()
{
MyThrowable = Hand.GetComponentInChildren();
MyWeapon = Hand.GetComponentInChildren();
if (MyWeapon != isActiveAndEnabled) { }
else
{
attackTimer += Time.deltaTime;
if (Input.GetMouseButtonUp(0) && attackTimer >= MyWeapon.attackCoolDown)
{
attackTimer = 0f;
DoAttack();
Hand.GetComponentInChildren().Play();

        }
    }
    if (MyThrowable != isActiveAndEnabled) { }
    else
    {
        if (MyThrowable.tag == "throwable" && (Input.GetMouseButtonUp(1)))
        {
            DoThrow();
            Hand.GetComponentInChildren<Animation>().Play("Throw");
            gameObject.SetActive(false);
        }
    }

}

And neither of them are throwables (I know I don’t need the throwables tag)

It is likely that the problem is with the animation and not with your script.

  1. In your Project window, search for the animation in question.
  2. In your Inspector window, click on Loop Time. If you can’t edit it, follow the rest of the steps. Otherwise you should have the animation working as you want.
  3. (Follow only if the animation can’t be edited) Duplicate the animation. Select your duplicate and click on Loop Time.
  4. Go to the object that has that animation. If it has an Animation component, then change the old animation with your duplicate. Otherwise, if it has an Animator component, double click it (so the Animator window opens up), click on the state that has the old animation, and replace it with your duplicate.

In PowerPoint, you can control when an animation effect starts and the speed at which it happens. You can even repeat or rewind the effect to get just the right look and feel for your presentation. This article will show you a few ways to fine-tune the animations in your presentations myprepaidcenter activation