I have a function to move a point over to different positions. I have a positions table containing all the Xs and Ys of each position, a position counter (posCounter) do keep track of where the point is and a maxPos, which is pretty much the lenght of the table positions.
In this code snippet, everything after if posCounter <= maxPos then
shouldn't run if the posCounter variable is greater than 3, but I still get an error for exceeding the table's limit.
local maxPos = 3
local posCounter = 1
local function movePointToNext( event )
if posCounter <= maxPos then
posCounter = posCounter + 1
transition.to( pointOnMap, { x = positions[posCounter].x, y = positions[posCounter].y } )
end
end