Is "Ispointerovergameobject" Deprecated in Unity 2019.2+?

I'm trying to detect if my cursor is over a UI element in the scene (not in the editor). In past versions, I could just use EventSystems.EventSystem.IsPointerOverGameObject(), but it seems that EventSystems no longer exists as a part of UnityEngine.

Looking at the documenation for 2019.2, UnityEngine.EventSystems is not there, but in 2019.1 it is. The release notes make no mention of this that i can see. Just gone.

So, how am I to detect when a cursor is over a UI element?

1

1 Answer

Alright, this was unrelated to the documentation. EventSystem clearly still exists because it exists in my scene. Another cursory look revealed that my IDE was giving me trouble which lead to errors in the debugger.

The best way to get at this is still EventSystem.current.IsPointerOverGameObject(), and make sure you are using UnityEngine.EventSystems.

However, the documentation is STILL missing it.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest