Now another object doesn’t remove, it stays on screen.
Even before removal print says what weapon is nil, but it is still on screen.
Example of my code:
function a()
local weapon = display.newImageRect(...)
...
end
function b()
print(weapon)
display.remove( weapon )
end