Hello, I am using Unity 2017 and I am currently working on an In-game editor.
With Camera.main. ScreenToWorldPoint(Input.mousePosition) I am looking up the current coordinates of the cursor in WorldSpace. Problem is that If I instantiate GameObjects with that and I use the UI, I am instantiating elements behind the UI in WorldSpace. Is there a function or way to check whether the mouse is over an UI object?
I was able to check if the cursor was over an UI element with following function, returning a boolean
EventSystem.current.IsPointerOverGameObject()