How would I play a 2D sprite full animation with "Fire1" input?
Here is the code.
if (Input.GetButtonDown("Fire1"))
{
Shoot();
animator.SetBool("IsShooting", true);
}
if (Input.GetButtonUp("Fire1"))
{
animator.SetBool("IsShooting", false);
}
What I want to do is whenever I left click "Fire1", play the full animation I have. However when I left click and immediately let off the mouse, the animation stops on 1 frame. If I hold left click then it loops the animation fully. how would I go about oneshoting an animation whenever I click?
Comment
Your answer
Follow this Question
Related Questions
Why is WrapMode.ClampForever is not working anymore? 0 Answers
2D Animation Feet Pivot Point 0 Answers
Can't change Animation speed in Inspector 0 Answers
Building an Asset Bundle with animation. 0 Answers
How to make basic 2D flip-clock in unity 0 Answers