Animation playing twice upon clicking twice within first animation
I have an animation that is set up in the animator where the entry box is connected to the "Idle" animation box and the "Idle" and "Shooting" animations are both connected to each other. Note that the "Idle" animation is just an animation with no movement. The transition from the "Idle" animation to the "Shooting" animation has the exit time checkbox unchecked, the conditions included a trigger called "Shoot" which became active upon the player pressing left click and the fixed duration checkbox was unchecked. The transition from "Shooting" to "Idle" was relatively untouched, although the exit time was set to 1. In both transitions, the transition duration was set to 0. The "Any State" box isn't connected to anything. The object that the animator is attached to also contains a script that includes:
Animator shotgunAnimator;
// Start is called before the first frame update
void Start()
{
shotgunAnimator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
shotgunAnimator.SetTrigger("Shoot");
}
}
I've tried changing (Input.GetMouseButtonDown(0)) to (Input.GeyKeyDown(KeyCode.Mouse0)) but nothing changed. The "Shooting" animation is the animation that plays twice. Whenever I click twice or more in the time that the first animation has played, the animation repeats, but only once. Any tips?
Your answer
![](https://koobas.hobune.stream/wayback/20220613035701im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can I duplicate a single frame of animation at runtime? 0 Answers
Prefab animations keeps teasing me 1 Answer
CAT, Bones or Biped? (3D MAx) 0 Answers
Offset Reload Animation to Fit New Model 0 Answers
Can unity animate 3D objects? 0 Answers