attack animation script

I need a script that for every left click on the mouse button an animation should play.for an example: First left click will play the attack animation from frame 1 to frame 25 second click will play the attack animation from frame 25 to 50 and so on.When you don’t click the left mouse button for a while (lets say 1.5 seconds) the script should go back to the first animation.

In other words the whole animation should start over so when you click the left mouse button again after 1.5 seconds the animation from frame 1 to frame 25 should play and when you click it again it should play the animation from frame 25 to frame 50 and so on. the frames I entered here are not specified yet and I havent done the animation so you can put anything you want. i will go in and change the frames myself later when im done.

I’m afraid you’ll have to learn programming a bit. You would start splitting your whole animation in several animations (check Unity - Manual: Legacy Animation System ). Here’s something that you could start with:

function Update()
{
    if(Input.GetMouseButtonDown(0))
      animation.CrossFade("Attack");
}