Tried finding an answer and couldn’t find one so sorry if it’s a repeat, but i’m trying to make a grid system and I wanted each coordinate pair in the table to have a value
function TileMap:Start()
for x = 1, self.mapSizeX do
for z = 1, self.mapSizeZ do
local tile = findCoordinate(self.tiles, {x, z})
table.insert(self.tiles, {x, z})
end
end
print(self.tiles)
end
This prints out [key] = {x, y} (256 = {16, 16} for example), but what i’m trying to have it print {x, y} = 1 (so now the array is the key and i can change it’s value by just finding the coordinates on the grid). Is this possible or is there an easier/different way to go about this