I have this error: attempt to perform arithmetic on upvalue ‘incTimeOver’ (a nil value)
On the line shown below
local incTimeOver local spawnColors -- create() function scene:create( event ) --left out stuff spawnColors = function ( event ) --check if difficulty needs to be increased incTimeOver = incTimeOver - spawnTime --line of error if incTimeOver \< 0 then incTimeOver = incTime increaseDifficulty() end end
Later on in the will show function I assign a value to the variable,
and in the did show function I call the spawnColors function.
I have spawnColors function in my create function so I could access the scene.group.
what I find weird is that I get a error of a nil value, and a the time the create function is called it is nill, but the function in it should not run so why do i get this error?