Find how many frames an animation has from code

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


I imagine this is quite easy but does anyone know how I can check how many frames are in a given animation?

I am thinking something like


but despite looking in the documentation for animated sprite I cannot see a way to know what the number of animation frames are in a given animation.

:bust_in_silhouette: Reply From: horsecar123

var passs=true
func _process(delta):
if passs:
$AnimatedSprite.frame=100#this value should above your how many frames you have
var max_frame_index=$AnimatedSprite.frame