Even with delay all objects appear in display at once… what do I do?

[lua]local path = pather:getPath(startx,starty, endx,endy)

if path then
     compPath = display.newGroup();
     for node, count in path:nodes() do
          --timer.performWithDelay( 1000, function (event)
               print((‘Step: %d - x: %d - y: %d’):format(count, node:getX(), node:getY()))
               local tile = display.newRect((node:getX() * 50) - 25, (node:getY() * 50) - 25, 48, 48)
               colorCell(tile, 0, 0, 255)
               tile.alpha = 0

               usleep(500);
               transition.fadeIn( tile, { time=1500 } )
               compPath:insert(tile)

          --end
          --)

     end
end[/lua]

I have this path that I am trying to animate as it appears but it seems to all show at once even with a delay or if I put it in a timer to go in spurts. Do I have to be displaying it using framerate at every second instead?

What am I missing?

** FIXED TYPO - Didn’t see the other ‘count’ variable you had **

Try making this change:

local count2 = 0 compPath = display.newGroup(); for node, count in path:nodes() do count2 = count2 + 1 timer.performWithDelay( 1000 \* count2, function (event)

You are currently delaying them all by 1000ms, but using the same starting time.  you need to increase the delay per subsequent iteration through the loop.

Thanks this worked great!

** FIXED TYPO - Didn’t see the other ‘count’ variable you had **

Try making this change:

local count2 = 0 compPath = display.newGroup(); for node, count in path:nodes() do count2 = count2 + 1 timer.performWithDelay( 1000 \* count2, function (event)

You are currently delaying them all by 1000ms, but using the same starting time.  you need to increase the delay per subsequent iteration through the loop.

Thanks this worked great!