Hi,
I have a sprite listener attached to my sprite sheet so I change animation on the “ended” phase of animation playback but this causes my animation playback to miss the last frame of my animation. Here is my “sprite” event handler:
local function bodySpriteListener( event ) if ( event.phase == "ended" ) then local thisSprite = event.target --"event.target" references the sprite thisSprite:setSequence("idle") thisSprite:play() end end
and my animation sequence:
local animationSequenceData = { { name = "idle", frames = { 1, 2, 3 }, time = 300, loopCount = 0 }, { name = "chew", frames = { 4, 5, 6, 7, 8 }, time = 500, loopCount = 1 }, }
What am I doing wrong?
Thanks.