Hi guys,
What is the correct way to iterate through a nested table like this one
game\_data ={
collection1 = {
physicsGameItems ={
{name= "candy1", width=35,height= 35},
{name= "candy2", width=45,height= 35},
}
},
collection2 ={
physicsGameItems ={
{name= "candy1",width=35,height= 35 },
}
}
}
The output I want to get from this table, is the contents of physicsGameItems from collection1.
so far I have this, but as you can see I can’t figure out how to iterate inside collection1
for k,v in pairs(physicsCandyItems) do
if k == "collection1"then
--Im stuck here
end
end
thanks a lot for your help [import]uid: 74667 topic_id: 31360 reply_id: 331360[/import]