- Home /
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;
}
}
Comment
Answer by VisionNext · May 18, 2014 at 10:38 AM
make sure that your aiming animation is not set to loop
Your answer
Follow this Question
Related Questions
FPS Aim Down Sights. Exact Position. 1 Answer
Mouse to control animations 0 Answers
Mouse Click Animation 3 Answers
FPSInputController and Character Animation 1 Answer
Crouch Scale Problem! 0 Answers