hi I’m getting a small error when i try to remove this object
[lua]
local bar3 = display.newRect(130,300,150,30)
physics.addBody(bar3,“static”)[/lua]
because of this code but the code thats causing a error is necessary for the app
[lua]local myListener = function( event )
if bar3.x < -10 then
bar3.x = 300
elseif bar3.x > 430 then
bar3.x = -40
transition.to(bar3,{time = 500, x=1100})
end
end
Runtime:addEventListener( “enterFrame”, myListener )[/lua]
the error I’m getting is
(Attempt to compare nil with number
File: game.lua
Line: 80
stack traceback:
game.lua:80: in function <game.lua:78>
?: in function <?:205>)