Sprite animation on button press?

Hello.

I was wondering if there is anyway to get the player to swap to a different character sprite animation when a specific button is pressed, then revert back to the original walking sprite.

What I'm trying to pull off is when the player presses a button a roll animation will happen. 

I'm not sure if this is possible through eventing. If not, is there a script that could do this?
you can change the actor sprite by event commands, and use set move route to turn between different parts of the sprite.


You can use a parallel process to check for button press.


The only tricky part would be to synchronise the sprite changes with any movement, there you'll have to experiment.
Thanks for the quick reply. I'll try this out
if button press

if switch1 is off

do change grafic and stuff

turn switch 1 on

else nothing

else

if switch1 is on

change grafic back to normal

turn switch 1 off.

thisway the change grafic is just executed one time when needed. Changing Actor Grafic every frame is one of the stuffs that burns/uses most of the performance reserves. Maybe this helps, if you do something else and this is not needed, than just ignore it 🙂 .
Thanks! Worked very well 🙂
Thanks! Worked very well 🙂
Hei, I am new here and hope i can reach someone here 🙂 I am too dumb to get the description of Bex. Could you make a screenshot of the Final script?

@Kim-Lo, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please make a new thread instead. You can link to this thread if you want.

Original thread: https://forums.rpgmakerweb.com/threads/sprite-animation-on-button-press.45912/