Setting a specific frame on a gameobject (SOLVED)

I have a player go with a sprite attached and I am trying to
make it so I can choose the frame to display…

I setup in init the frames
sprite.play_flipbook("#sprite", “move”)

Then in Update I work out the frame to display based on speed
frame = math.floor(work out the frame)

go.set("#sprite", “cursor”, frame)
print(frame)

The frame number is correct but the animation does not change.
Maybe I am using the wrong method… The sprite documentation on cursor doesnt make it clear to me at least what its used for.

Thanks for any help.
Regards
Blue.

Keep in mind that the cursor is normalized and should be between 0.0 and 1.0. Not the frame number itself.

Brilliant… works a treat. Thanks.

1 Like