Changing sprite frames based on pickups

Godot Version

4.3

Question

I am very new to godot and am trying to have my animatedsprite2D change frame each time an item is picked up. I have a score set up that is currently working so I was hoping that I could do it simply like " score = spriteframe " or even typing out each " if: score =1 frame =1 " for each frame (only 5) however I am not sure what func, var, or input event to start with and where in the sprite script to place it. I would appreciate any help with this issue!

Put it in the collision function of your pickup, reference the AnimatedSprite2D and then change the frame property. You can read more here:

I also recommend you learn how to read and use the Godot documentation it is very useful and saves you time :).