help animating player in corona sdk

I am trying to animating the player on a line the player draws. Right now the player is animating at the beginning and end of the line but not while he is moving on the line. This is the code for movingOnLine

function movePlayerOnLine(event)
–for the original image replace all rich with player.
if posCount ~= linePart then
richDir = math.atan2(ractgangle_hit[posCount].y-rich.y,ractgangle_hit[posCount].x-rich.x)*180/math.pi
playerSpeed = 5
rich.x = rich.x + math.cos(richDir*math.pi/180)*playerSpeed
rich.y = rich.y + math.sin(richDir*math.pi/180)*playerSpeed
if rich.x < ractgangle_hit[posCount].x+playerSpeed*10 and rich.x > ractgangle_hit[posCount].x-playerSpeed*10 then
if rich.y < ractgangle_hit[posCount].y+playerSpeed*10 and rich.y > ractgangle_hit[posCount].y-playerSpeed*10 then
rich:prepare(“rich”)
rich:play()
posCount = posCount + 1
end
end [import]uid: 94237 topic_id: 17065 reply_id: 317065[/import]

Are you pausing the player ( rich:pause() ) someplace else in the code?

You could try moving the prepare and play lines to the beginning of this function. [import]uid: 67839 topic_id: 17065 reply_id: 64091[/import]

no the player isn’t being paused. Would that have an affect? [import]uid: 94237 topic_id: 17065 reply_id: 64095[/import]

i moved the prepare and play lines to the beginning and that didn’t change anything. [import]uid: 94237 topic_id: 17065 reply_id: 64097[/import]