0 votes

Hello

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

$AnimatedSprite.Length_Animation("Default")

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.

Godot version 3.4
in Engine by (51 points)

1 Answer

0 votes

var passs=true
func process(delta):
if passs:
memory=$AnimatedSprite.frame
$AnimatedSprite.frame=100#this value should above your how many frames you have
var max
frameindex=$AnimatedSprite.frame
print(max
frame_index)
$AnimatedSprite.frame=memory
passs=false

by (147 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.