I am a newbie programmer, just starting out with lua and Defold, and basically I have a table called objects, and later in the code I am looping through the table using the method pairs, and in that for loop I try to access the item and use it, but I get an error saying:
ERROR:SCRIPT: level/controller.script:57: attempt to index local 'lvlObj' (a userdata value)
Anyways I was wondering what this error derives from, and how do I fix it. (pipe_reset is a boolean variable, should have nothing to do with the error)
pipe_reset = false
local objects = {}
... later in the code
if pipe_reset then
for k in pairs(objects) do
local lvlObj = objects [k]
lvlObj.delete()
objects [k] = nil
end
pipe_reset = false
end