Hey, i have created an animation and want to call it with a state based machine. In the machine i have set a trigger named “Charge” to call the clip. But the clip only plays once (despite the fact that the SetTrigger(“Charge”) function is called every .5 seconds in the code).
My code (the parts that are relevant):
void Update ()
{
timer += Time.deltaTime;
if (type == style.Circle)
{
if (timer >= delay)
{
//play charging animation
if (charge)
{
anim.SetTrigger("Charge");
}
else
shootCircle();
timer = 0f;
}
}
}
The type enum is set to style.Circle and the charge bool is set to true. If i set charge to false the shootCircle() methode is called properly so the trigger is defenetly called. delay is set to .5 seconds.
Here are a few screenshots that might come handy:
alt textalt textalt text
The transition:
alt text
And the Charge Animation:
alt text
Thank you so much for your help! And sorry for my bad english.