C
C#2y ago
craizerbr

❔ Stop animation (if and else)

I made this code and I have a walk animation when I press "W", but I don't know a code to stop the animation if the "W" key it's not being pressed. I have tried many ways, but couldn't find one that works.
7 Replies
JakenVeina
JakenVeina2y ago
this provides basically 0 actual context needed to answer the question but if I just go crazy with assumptions is there a .RemoveTrigger() method? or .SetTrigger("IsNotWalking")?
craizerbr
craizerbrOP2y ago
not in this script
JakenVeina
JakenVeina2y ago
well what is .SetTrigger() then?
craizerbr
craizerbrOP2y ago
I mean that I don't have a "IsNotWalking" one I'm still new to code, so I'm watching the unity code free course
JakenVeina
JakenVeina2y ago
well, then I gotta recommend you keep following that if you've already deviated from that, then I reiterate: what is .SetTrigger()?
Anchy
Anchy2y ago
There is ResetTrigger if this is the Unity Animator close enough to RemoveTrigger 😄
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server