I’ve got a gun in my game to fire, and I’ve just created the animation for it. I setted up a code so that when I pressed down “fire” (LMB) that the animation would play. How ever it keeps on looping after I pressed it, which obviously is unideal. Here is the code (using Java)
var animation_bool : boolean ;
function Update()
{
if(animation_bool == true)
{
animation.Play("backfire");
}
if(Input.GetButtonDown("fire"))
{
animation_bool = true;
}
}