C
C#14mo 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
JakenVeina14mo 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
craizerbr14mo ago
not in this script
JakenVeina
JakenVeina14mo ago
well what is .SetTrigger() then?
craizerbr
craizerbr14mo 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
JakenVeina14mo ago
well, then I gotta recommend you keep following that if you've already deviated from that, then I reiterate: what is .SetTrigger()?
Anchy
Anchy14mo ago
There is ResetTrigger if this is the Unity Animator close enough to RemoveTrigger 😄
Accord
Accord14mo 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.