I’ve tried attaching a script to the image to do it when the mouse is over, which kind of works, but if I go over one of the other images, it doesn’t detect it. All the smaller images are separate UI objects that are enabled when selecting different game objects. I tried to run a ray to detect if the mouse was over any image, but it doesn’t seem to work at all.
All I need to do is have a certain part of a script that handles unit movement to bypass left clicking as long as I am mouse over the lower menu part of the screen. Just looking for ideas. Thanks.
You’d need to poll your mouse position every frame and set a bool like isOverMenu. If it’s true, then a condition in your unit movement script will disallow the default actions.
Your shapes at bottom are simple boxes, so you can use a rect bounds kind of check quite easily.
Right, that’s what I mean. I plan on enabling a bool on my script and having it not perform the function on click if the bool is true, which would mean over my UI.