Check whether touch is interacting with new interface?

Hi there!

I occasionally have the problem that while the player is interacting with the in-game overlay, the clicks and touches also reach the game world and interact with that gameworld.

How can I avoid this? Can anyone point me into a direction in which I can check whether I’m currently touching the interface?

Thanks a bunch!!

So… there’s nothing for this? Does this mean that every button in my in-game overlay will also have to cancel every interaction with the game world?

a quick search of the forums will lead you to the answer. EventSystemManager.currentSystem.IsPointerOverEventSystemObject()

I did, but if you don’t know what to look for it’s pretty difficult to find something this specific. For instance, the fact that this function has ‘pointer’ in the name is confusing in the context of a game for mobile touch screens.

Anyway, thanks Phil.

Just a heads up - it seems like a bunch of things got renamed, am I correct? It now seems to be:

EventSystem.current.IsPointerOverGameObject(int pointerId);

Also, what is the pointerId parameter?

if (EventSystem.current.IsPointerOverGameObject())
    Debug.Log("OVER");
else
    Debug.Log("NOT OVER");

Why doesn’t this work?

need more context.