How to stop a function while colliding with the character

You want stop event tick when there is overlap?