Question by
stormstrider · Apr 06, 2018 at 10:35 PM ·
animationloop
Animation key press loop
I'm trying to make a game where you click and the player attacks with a sword, i did some code but it only attacks once, i want it to attack every time i click not just the first time i click...public class playerAttack : MonoBehaviour {
public Animator anim;
void Start () {
anim = GetComponent<Animator>();
}
void Update () {
while (Input.GetMouseButton(0))
{
anim.Play("Player Attack");
}
}
} here is my code
Comment
Your answer
Follow this Question
Related Questions
How do I delete objects in an animation in a certain order? 1 Answer
Can not select loop time or any other stuff 0 Answers
Animation Panel: how to turn an existing loop into just a standing sprite and then implement it 0 Answers
When walking animation loops in timeline, it resets the player´s position back to the start 0 Answers
How to get perfect position animation with root motion? 1 Answer