I want to be able to restart my game when someone clicks a button.
1 2 3 4 5 6 7 8 9 10 11 | local onCollision = function (self, event) if event.phase == "began" then if event.other.name == "spikes" then self:removeSelf() self = nil end end end |
Did you accidentally post this before finishing it?
Your last line seems to be the start of a question but it isn't clear what you want to know.
What's the problem? :)