table.remove ends in position out of bounds
snippet in lua

table.remove ends in position out of bounds

user8424

-- setup players
players = {}
for i=0, 3 do
    local gp = InputHandler:gamepad(i)
    if(gp:isConnected()) then
        logMessage(i .. " is connected")
        players[i+1] = createCharacter(i, gp)
    end
end