How to make an Attack animation play once

I wanna make an attack animation for my character, every time the player clicks the left mouse button. How can i do that? I have tried the Animator.Play() but it wont work. Any help?

The arguably best way to use animations is with an ANIMATOR. After creating an animator and by putting it on the actual object to be animated, add your animations for that object to it. Then in the instance of your attack, make sure the animation doesn’t have looping checked. Add an animation trigger and have an exit time into some other animation such as walk. In general however I’d suggest watching a couple YouTube tutorials on the topic.