Hello, so I recently spent a very long time putting together a shop for my game, but I realized it was much harder to load the sprites from the store to being what the player played as because they aren't stationary icons, but rather animated sprites. Even for the first skin just being a color palette change, but all the same animations, I'm still having a lot of trouble figuring it out. Anyways this is the script I currently have for trying to have it load the new "skin." Instead of putting a texture variable for an icon path, I have it set as "$AnimatedSprite.set_animation("red right, red up")" The relevant script looks like this:
var textures = [
$AnimatedSprite.set_animation("red right, red up")
screensize = getviewportrect().size
$AnimatedSprite.textures = load(textures[Global.store.Selected])
The script above is from the Player.gd, and the parent node is "Player", followed by "AnimatedSprite", and "CollisionShape2D" as the children. The error described in the title occurs when I tried to make the "textures" variable. I've also tried $Player/AnimatedSprite, as well as "set_animations" but neither make the error go away. Any tips or am I completely backwards with how I'm trying to do this?