From the unity documentation: https://docs.unity3d.com/Manual/AnimationParameters.html
Trigger parameter: a boolean parameter that is reset by the controller when consumed by a transition (represented by a circle button)
So it should play the animantion once right?
In my current game I already set my animation transition condition to trigger, then in gameObject script I also set the parameter, but it plays more than once.
Here are my animation parameter
Here are my animation transition condition
And here are my gameObject script to set the parameter
Animator anim;
Start() {
anim = GetComponent<Animator>();
}
void shoot() {
anim.SetTrigger("shoot");
}
EDIT:
this is the transition out of PlayerShoot, returning to PlayerIdle