Godot 4.4.1
Situation
Hi, I currently have my character set up with 3 states (1-3 ) and 8 directions (1-8). Every animation has 8 frames, so its 3x a 8x8spritesheet. Every sheet has an identical structure and frame number.
And I have a code segment that translates the variables
vAnimState (integer, 1-3) to vStateName (string) and
vAnimDirection (integer, 1-8) to vDirectionName (string)
to define the animation that shall be played.
Currently I have this code here set up to determine which animation to use:
*(So in the end it plays for example the animation âanimLin_walk_upleftâ)
Movement and Animation works so far, but everytime I change the direction, the new animation starts at its first frame. Thanks to the isometric view and only 8 directions and frames its barely noticeable, but therefore it looks a bit like lagging, when the animation is reset at every direction change.
Question
Is there a way to get the number of the current frame thats shown when the direction changes - and to use a frame number to define at which frame the other animation shall resume?
(So I could build a math equation that uses the value of the current animation + current frame nr and the value of the new animation, to define at which frame the new animation should start)