I was working on some stuff and I couldn’t figure out the reason it wasnt letting me delete the object after a 5 second timer!
test.collision = function(self, event) if ( event.phase == "began" ) then timer.performWithDelay(5000, function() self:removeSelf() self=nil end) end end test:addEventListener( "collision", test )
I dont understand why it doesnt work but im getting this error
attempt to call method 'removeSelf' (a nil value)
Any help with be greatly appreciated!