sorry if this is a dumb question but i am trying to make a dash action for my character, but when i use “isPressed” the sprite animation only plays for like a milisecond. I try using “wasPressed” but i have to hold down the key for the entire animation to play through. I need it so that when i tap shift, the entire animation plays in one go
Hi @amandagax and welcome!
I guess your code for ‘idle’ or ‘move’ is overwriting your ‘dash’ animation.
You’ll probably need something like a timer to give your ‘dash’ animation enough time to complete, before other code of your script can continue. You can check the topic below for some example code of a timer.
Maybe there is a better solution using the API’s of the page below, but I haven’t used sprite animations myself yet so I’m not sure.
https://api.playcanvas.com/classes/Engine.SpriteAnimationClip.html
o damn i thought so, ill try out the timer! never used it before