How to make on click GUI elements not trigger player action

I saw similar posts on this question but i cannot seem to find an answer that works for me so i though i might create a question myself to ask the question. So i have a game in which a player jumps on mouse click, but i have a problem because i have a pause button GUI element that if clicked, also triggers the player to jump right before pausing the game. i need a way to detect if any GUI has been clicked, so it doesn’t trigger the jump action, only the thing i assigned it to do. Thanks in advance.

We had the same problem, basicly you just need to add Event to your GUI, where on pointerEnter and pointerExit you set your own static bool like “onGUI” to true or false, and then in your player script, you check for this static value.