attempt to upvalue physics when transitioning away from the scene

    kinda stumped in solving this since i can not seem to figure out how its being upvalued i removed the table with all the objects from the scene at hide scene with 

local spawnTable = {}

function scene:hide( event ) --Perfect
local sceneGroup = self.view

local phase = event.phase

   if event.phase == “will” then

     for i=#spawnTable,1,-1 do
          display.remove(spawnTable[i])  
          spawnTable[i] = nil
          table.remove(spawnTable,i)
       end

    end

end

i changed the code around it so much that i just need another pair of eyes to help clear my confusion.

screen shots of the error and the section of code that it is disliking. if need any other part of the code let me know the game was working till now when i tried to transition to another screen and somehow my physics for my objects was malfunctioning was able to transition before just fine till i added the objects(big chance one of the changes i did messed it up somewhere)

Hi @chris_tucker20,

Can you post exactly what line 146 is, as that is the line cited in the error message?

As for that error, generally it means that you didn’t put the variable reference in the proper scope. It’s looking for a reference to “physics” which you should have require()-d in the proper scope, but it’s not finding that.

Best regards,

Brent

Hi @chris_tucker20,

Can you post exactly what line 146 is, as that is the line cited in the error message?

As for that error, generally it means that you didn’t put the variable reference in the proper scope. It’s looking for a reference to “physics” which you should have require()-d in the proper scope, but it’s not finding that.

Best regards,

Brent