I’m not sure how removing display objects affect order of elements of sceneGroup “table”. So maybe try this code
local numChildren = sceneGroup.numChildren for i=numChildren,1, -1 do local child = sceneGroup[i] if child.id == "s" then local scorepop = display.newText( { parent=sceneGroup, text=child.id, x=child.x, y=child.y, fontSize=16, align="center", onComplete=display.remove } ) scorepop:setFillColor( 1,1,1 ) transition.to(scorepop, {time=500, alpha=0.0, y=(scorepop.y-100)}) end end for i=numChildren,1, -1 do local child = sceneGroup[i] if child.id == "s" then display.remove( child ) child = nil end end
What is color of your background scene? Maybe you don’t see text (transition of scorepop object) because color of text and background are similar (white)?