Hello i need help me script not stop animation bool help me pls here is script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Attack : MonoBehaviour
{
// Start is called before the first frame update
Animator anim;
void Start()
{
anim = gameObject.GetComponent<Animator>();
}
// Update is called once per frame
public void attack()
{
anim.SetBool("Attack", true);
}
private void Update()
{
if (anim.GetCurrentAnimatorStateInfo(0).IsName("Attack"))
{
anim.SetBool("Attack", false);
}
}
}