How to stop a function while colliding with the character

yes! I Want it