What is the best way to change the texture of a Sprite?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MaaaxiKing

I have a Player and i if I jump I want that the AnimatedSprite has the jump texture and when I land it should come back to idle. But idle has only one frame and I want to call a method when it goes to idle and not when idle is finished because it emits the animation_finished signal forever. Should I just change the AnimatedSprite to a Sprite and change the texture and then call a method to do something? Or a better question would be how to stop the animation from playing forever. I just want it to play once.

:bust_in_silhouette: Reply From: MaaaxiKing

I found out that in the bottom left corner there’s a Loop ToggleButton enabled by default. Just disable and it’s fine.

But can I make that a function is called everytime an animation was changed?

MaaaxiKing | 2020-06-25 15:16