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)