Getting the frame number of the player after manually setting it? (Possible bug?)

Hi all,

Not sure if this is a bug, or if I'm not understanding the events/animation model, but I don't seem to be able to get the frame number of the player's animation. I'm swapping in the animated tile, which has 2 frames and FPS set to 0. Then I use "frame" during the "on crank" event inside "player" to change the frame.

on crank do
    playerAnim_miningFrame = frame
    playerAnim_miningFrame++
    // 2 frames only for now
    if playerAnim_miningFrame>1 then // loop back to start
        playerAnim_miningFrame = 0
    end
    log "Player anim frame: {playerAnim_miningFrame}"
    frame playerAnim_miningFrame

However, the first call to "frame" always returns 0, so frame 1 is always set.

I've tried using "tell event.player" for both "frame" calls, but that doesn't change anything.

Am I missing something?

1 Like