x


aiming with animation

i want to have animation of aiming. i wrote my own script for it and its not working properly. every time i hold on the the right mouse button, the animation keep getting played over and over. is there a way to fix that?

here is the script.

var PlayAim = false;

function Update(){

if(Input.GetButton("Fire2")){

gameObject.animation["Aim"].speed= 6;

    animation.Play("Aim");

}

if(!Input.GetButton("Fire2")){

gameObject.animation["Aim"].speed = -6;

}

}

more ▼

asked Feb 26 '12 at 12:04 AM

LoopyEL_BARTO gravatar image

LoopyEL_BARTO
1 2 2 3

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

0 answers: sort voted first
Be the first one to answer this question
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:

x5682
x1491
x1377
x1310
x148

asked: Feb 26 '12 at 12:04 AM

Seen: 849 times

Last Updated: Feb 26 '13 at 11:27 PM