Hey guys, I'm a beginner dev and I need help with the following problem...

When the character collects the item, it is to change the animation to "collect" and finish the animation, but when the item is collected, the "collect" animation is running in a loop, how do I make it run only once and stop once the item is collected ?

follow prints of my code and the functionality screen

The solution for this issue could be have a bool variable, lets named it "collected".
First you need to add this variable to your project, depending on the type of item it can be in the same node as your item or a different one, then you need to set the default value to false, this means that by default the item has not been picked up.

In the function that detects the collision between the player and the item you need to set collected to true and add an if statement there that checks the collected value, so when the item is picked up the if statement checks and if collected is true it runs the animation once.
To finish you need to add another if statement in your update() function where it