@lemu_kymoh I'll put the exact code I'm using. (I made things less specific for the sake of the original post.)
@onready var sprPlanet : AnimatedSprite2D = $sprPlanet ... func ANIMATION_FRAME(): # choose a frame from sprPlanet ranging from 0 to the number of how many frames there are. sprPlanet.frame = randi_range(0,sprPlanet.sprite_frames.get_frame_count("planet_types") - 1)Well as it turns out you're right! It worked. I'm not really sure what went wrong with the other tutorials...