Best way to ignore mouse clicks in specific screen areas?

Hi,

Normally when the player clicks on the screen I do a raycast to get the world position so he can move his game character to that position.

However, there are certain icons on the screen that the user can click on. When he clicks on one of those I want to ignore the raycast stuff.

(at the moment i get the character movement and the icon behavior. I just want the icon behavior)

What's the best way to do this?

Thanks

maybe is not the best, but is a way the way i use is checking for the coordinates i think your icon is a GUI, if so you have its position and its area ie pos 0,0 50w50h in this case, when you click the screen the raycast is called, but before that i make a validation with Input.MousePosition, this give me x and y values, lets say the mouse input was 49,35, if you check the GUI location, it is from 0 to 50 width and from 0 to 50 height, then if your values are inside these intervals, make the if statement to avoid running the part of moving your character

hope this is the answer you are looking, or at least it helps