Topic was automatically imported from the old Question2Answer platform.
Asked By
Radgrid728
Could you tell me how to use a button to change sprite’s texture several times?
For example, let’s just that there is a button and when it is pressed, it changes sprite texture into png1. And then when I press it again, the sprite texture changes into png2.
If Input.is_action_pressed("Your Button"):
your_function_for_changing_sprite()
This is for the button mechanics
For Sprite, I recommend just use animated sprite and then add create an animation. And after that, every time you press the button your frame changes by 1