Im a newbie and been goggled searching and I cannot figure out or find an answer on why I’m getting this message.
I’m trying to call an imageSheet and I getting this error message.
File: main.lua
Line: 47
Attempt to index local ‘tempCash’ (a nil value)
stack traceback:
main.lua:47: in function ‘setUpGameScreen’
main.lua:74: in main chunk
local tempCash
for i=1, #cashXPositions do
tempCash = display.newSprite(imageSheet,sequenceData)
tempCash.x = cashXPositions[i]
tempCash.y = cashYPositions[i]
tempCash:setSequence(“blank”)
tempCash:addEventListener(‘tap’, cashHit);
gameScreenGroup:insert(tempCash)
table.insert(allCash,tempCash)
Line 47
tempCash.x = cashXPositions[i]
Line 74 is
setUpGameScreen()