I am trying to to cancel my timer when the ball is tapped but it’s not working , and I’ve tried multiple ways .
function timerDown() timeLimit = timeLimit-1 timeLeft.text = timeLimit if(timeLimit==0)then storyboard.gotoScene("maxtime", "fade", 400) end end timer.performWithDelay(1000,timerDown,timeLimit) function onBallTap( event ) timer.cancel( timer ) storyboard.gotoScene("restart", "fade", 400) end function scene:enterScene(event) Ball:addEventListener( "tap", onBallTap ) end function scene:exitScene(event) Ball:removeEventListener( "tap", onBallTap ) end