Is there anyway to stop event propagation

Hi,

I have a pause button while playing game, so my player has behavior to move wherever touched. So when pause button clicked , player moves towards pause button.

Tried OnPointerClicked Interface on pause button but not working.

Current workaround is when player moves i set pause (image) raycast to false and using if(EventSystem.current.IsPointerOverGameObject()) return in Fixed Update Input.touchCount of Player

But it is making things clunky as player has to move continuously.

Is there any method like event.stopPropagation() or some thing similar? Thanks in Advance!

Working solution here : c# - How to make gameplay ignore clicks on UI Button in Unity3D? - Stack Overflow