EventSystem.current.IsPointerOverGameObject is not working since 5.6

Hi,

I’m developing a game level edition tool and I was using the function EventSystem.current.IsPointerOverGameObject() to differentiate between clicking on the menus and clicking on the game world. Everything worked smoothly until Unity 5.6 version. Why is this function not working anymore? Are there any plans to fix this critical bug? I’m trying some workaround but they only introduce unexpected problems.

In case Unity team is not going to fix this issue it would be good to know because to fix it in my project I would have to introduce a week of extra work to recover the original functionality.

You can check the style of the game editor in these tutorials I made:

Now, the function IsPointerOverGameObject is always returning “true” no matter where I press.

Thanks.

It’s still working properly for me. Did you recently add a physics raycaster that wasn’t there before?

I don’t know if that’s the right question to ask you, but I think it could be.

I have some code that, like you, checks if the pointer is over a gameobject (I use mine only for the UI). This way, dragging panels/sliding sliders, etc… won’t move my camera :wink: When I add a physics raycaster to my camera, about 90% of the time, just clicking anywhere and trying to drag “empty space” prevents my camera from moving, because of the code I mentioned.

If that’s not it for you, sorry not sure :slight_smile:

Thanks for the help. Yes, you were right. Several weeks ago I did some major change in the in-game UI system and since the game editor shares the same code as the game client some of the code was messing the editor. The solution that I’ve applied and it’s working for me is:

        if (GameConfig.Mode == GameConfig.MODE_PLAY_LEVEL)
        {
            this.gameObject.GetComponent<GvrPointerPhysicsRaycaster>().enabled = true;
            this.gameObject.GetComponent<PhysicsRaycaster>().enabled = true;
        }
        else
        {
            this.gameObject.GetComponent<GvrPointerPhysicsRaycaster>().enabled = false;
            this.gameObject.GetComponent<PhysicsRaycaster>().enabled = false;
        }

Cool, glad you found a solution :slight_smile: