x


Mouse press animation

i want it so that when i click and hold the left button it will keep playing the animation until i let go of the left mouse button here is what i have so far and doesn't work, it will move like a inch and i repeatedly click THEN click by click it plays the animation. function Update () { if (Input.GetMouseButtonDown(0)){ animation.CrossFade("Shoot Animation"); } }

I need It To play a looped animation when the left mouse button is held down but on release of the left mouse button it stops the animation.

more ▼

asked Sep 05 '11 at 09:37 PM

conflictbliz gravatar image

conflictbliz
26 14 16 19

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

hey mate,

if you change GetMouseButtonDown(0) to GetMouseButton(0) it should run the event continuously until the mouse is released :)

more ▼

answered Sep 06 '11 at 05:27 AM

nasapc123 gravatar image

nasapc123
121 2 3 5

that doesn't work only plays it once and then keeps on playing any other way?

Sep 09 '11 at 01:03 AM conflictbliz
(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:

x3768
x982
x225

asked: Sep 05 '11 at 09:37 PM

Seen: 836 times

Last Updated: Sep 09 '11 at 01:03 AM