- Home /
Loop Animation Help
Ive written this script which plays an animation when the left mouse button is clicked but it only plays the animation once, whereas I want it to loop over and over until the left mouse button has stopped being pressed, can anyone help?
function Update ()
{
if ( Input.GetButtonDown("Fire1") ) {
transform.animation.Play("Shoot");
}
}
Comment
Best Answer
Answer by roamcel · Oct 08, 2011 at 04:40 PM
You need to change the way the animation wraps, possibly in the start function of the class.
animation.wrapMode["Shoot"] = WrapMode.Loop;
Then, you must tell it to Stop in GetButtonUp.
Your answer
Follow this Question
Related Questions
Animation Scripting Help 1 Answer
Loop Animation In Script? 2 Answers
Trying to simply play this animation... Help please. 1 Answer