How to stop a function while colliding with the character

xD Thank you