Here is a weird bug that I occur, I Know my code works cause there is a chance that the error doesn’t occur
here is my code:
-- if resultHere ~= nil then resultHere = display.newImageRect("Assets/imgOpSuccess.png",285,110) resultHere.anchorY = 0 resultHere.x = centerX resultHere.y = 295 -- end if resultHere == nil then print("rsHere is nil") end if sceneGroup == nil then print("sceneGroup is nil") end -- if resultHere ~= nil then envelopeHere = display.newImageRect("Assets/imgEnvelope.png",285,150) envelopeHere.anchorY = 0 envelopeHere.x = centerX envelopeHere.y = 295 resultHere.y = 295 -- end b = b + 1 print(b) if resultHere ~= nil then sceneGroup:insert(resultHere) end if envelopeHere ~= nil then sceneGroup:insert(envelopeHere) end
Whenever this occurs, it always says that it has a nil variable. Where as there are no nil variables