#how can i make my animations only play once?

1 messages · Page 1 of 1 (latest)

misty mango
#

i have an animation that plays if u click a button, but you can click on the button again and it replays the animation, i would like to somehow fix that

#

this is the animation, basically u click on the button and it sends a trigger and the animation runs

nimble jungle
#
  1. Better not use any state, put an idle state and use transitions
  2. Use a bool in the code,
    if(animPlayed = false) { trigger anim animPlayed = true; }
#

you can also have a bool parameter in animation controller
then in transition -> trigger && animPlayed = false
you'll have to set the anim.SetBool("animPlayed", true); in code then