Set global variable to current animation frame

How do I get the current animation frame from a sprite (as a number)?

Look at the conditions for Sprite objects

Yes I can compare the number of the current animation frame there but that is not what I want to do.
I don’t want to do:
if frame = 1 set var = 1; if frame = 2 set var = 2;… and so on.
If want something like: set var to sprite.anmation.currentFrame()

Look at the Sprite expressions?

What do you mean? I didn’t find a complete documentation with all functions I can call from a sprite or animation object. It is not in the auto completion system either.

You can find them here:

@ashtray did you finally achieve it?

I’m trying to do something similar and I’m blocked with your same question

Thank you

Not every expression is listed in every function. You can see it for example in “change position of object” (like in 4ian’s screenshot).

This should do it:

number:

object_name.Sprite()

string:

ToString(object_name.Sprite())