Search Unity

EventSystemManager.currentSystem.IsPointerOverEventSystemObject()

Discussion in 'UGUI & TextMesh Pro' started by PiMuRho, Sep 8, 2014.

  1. PiMuRho

    PiMuRho

    Joined:
    Jul 11, 2012
    Posts:
    17
    Has something changed with EventSystemManager.currentSystem.IsPointerOverEventSystemObject() recently?
    I was using it to block raycasts from going through my UI elements and it was working perfectly before, but now it seems to be blocking all raycasts as if the entire screen was one big UI element.
    What I've currently got:

    Code (csharp):
    1.  
    2. if (Physics.Raycast(ray, out hit, 1000))
    3.                 {
    4.                     Debug.Log(hit.collider);
    5.                     mouseDownPoint = hit.point;
    6.                     //if we hit terrain
    7.                    
    8.                         //If we're not hitting the UI
    9.                        
    10.                             if (!EventSystemManager.currentSystem.IsPointerOverEventSystemObject())
    11.                             {
    12.                              DoMoreStuff();
    13.                             }
    14.                  }
    15.  
    and that blocks it all, not just over the UI elements.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Seems more likely you've recently added a UI element that you didn't realize was catching clicks. Try disabling pieces of your UI until the clickthrough behaves as expected. Once you've found the culprit, you can use a Canvas Group component to specify whether a part does or doesn't block clickthoughs.
     
    PiMuRho likes this.
  3. PiMuRho

    PiMuRho

    Joined:
    Jul 11, 2012
    Posts:
    17
    I went to do exactly that, uncommented the offending line, and it all works like it used to. No changes made. Maybe I was hallucinating! Thanks for your help :)