x


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.

more ▼

asked Jul 09 '12 at 08:08 PM

natsu12 gravatar image

natsu12
3 2 5 7

Well then you are going to either have to learn or hire someone. No one is going to write your game for free. Not trying to be mean but its gonna cost you, either time or money.

Jul 12 '12 at 03:50 AM Chimera3D
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I'm afraid you'll have to learn programming a bit. You would start splitting your whole animation in several animations (check http://docs.unity3d.com/Documentation/Manual/Animations.html ). Here's something that you could start with:

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

answered Jul 10 '12 at 10:32 AM

lyzard gravatar image

lyzard
176 5 6 7

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3806
x343
x155

asked: Jul 09 '12 at 08:08 PM

Seen: 687 times

Last Updated: Jul 12 '12 at 03:50 AM