Pointer Down event on a button still registering a hold even when I drag pointer away??

Hello everyone,

I have a 2D platformer for mobile and right now I am handling touches. To my UI buttons I added Event Trigger and then Pointer Down and Pointer Up to control walking. But I noticed some strange behavior of these events. When I press and hold the button (an arrow) and move the cursor away, my player continues running. What? That is something I do not want. Is there any solution of this or do I have to ray the button to know if the pointer is over the button? But how? There must be any simple way…

You should be able to bind OnPointerExit() to do the same thing as OnPointerUp().