Animation can only play once

Hi all,
I wanted to make a mechanism where if you press a key such as a spacebar, then it plays an attack animation every time you press it, but if I turn loop time off then after the animation plays it would go like this
123720-screen-shot-2018-09-01-at-13512-pm.png
and the blue bar at the end means that the animation is finished. But when I call for the animation to run again it doesn’t work

Thanks,
Larry

Hi,
I managed to find the answer, just make a parameter
123727-screen-shot-2018-09-01-at-51216-pm.png
that is a trigger and add it in the conditions in the transition
123730-screen-shot-2018-09-01-at-51224-pm.png
Then add these lines of codes:

private Animator animator; 

void Start () {
        animator.GetComponent<Animator>(); 
}
void Update () {
        if (Input.GetKeyDown(KeyCode.J))
        {
                GameObject.Find("player").GetComponent<Animator>().Play("Attack");
                animator.SetTrigger("Attacked");
        }
}

Thank you all so much for the support that helped me find this answer :slight_smile: