Im trying to make an animation play on a mouse click but it only goes once I’m trying to make it play more than once every time you click. I’ve been spending a few days trying to figure this out but i need someone with a smarter mind.
here is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class playerAttack : MonoBehaviour {

public Animator anim;

// Use this for initialization
void Start () {
    anim = GetComponent<Animator>();

// Update is called once per frame
void Update()
    if (Input.GetMouseButtonDown(0))
        anim.Play("Player Attack");


Your animator State in the animator window should be named “Player Attack” for your code to work…not the name of the Animation clip.

According to the docs, your usage of Play does not fit any given constructor.