Question by
stormstrider · Apr 06, 2018 at 03:38 AM ·
animationloopattack
Trying to make a loop animation of a sword slicing on click but wont work out (PLEASE HELP!)
When i click it only attacks once and doesn't attack anymore when i click. public class playerAttack : MonoBehaviour {
public Animator anim;
// Use this for initialization
void Start () {
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
while (Input.GetMouseButton(0))
{
anim.Play("Player Attack");
}
}
}
Comment
Your answer
Follow this Question
Related Questions
How to enemy animation attack player 0 Answers
Disable Looping an Animation by Default 0 Answers
Cool hurt animation 1 Answer
Can´t find the infinite loop in this script 0 Answers
Animation with string and attack animation problem 0 Answers