Good day
I was wondering how am I gonna turn my Object into nil, using this code, it doesn’t seem to turn into a nil:
local function remover(self) self:removeSelf() -- Removes the object self = nil -- It turns nil here end local rect = display.newRect(10,10,10,10) transition.to(rect, {x = 200, time = 2000, onComplete = remover) -- Moves the rect 200px and remove it after transition local function rectChecker(event) print(rect) -- Even if it is removed it always returns a "table:x012301blabla" end Runtime:addEventListener("enterFrame", rectChecker)
What is the proper way in removing and turning it into nil using a single function?