Search Unity

Question Get UI object over or find out if item over is 3d canvas or 2D!

Discussion in 'UGUI & TextMesh Pro' started by andyz, Jan 18, 2024.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,262
    I want to stop a lot of mouse related input happening when the cursor is over a screen space object. This is easy with EventSystem.current.IsPointerOverGameObject(), but if I also have a world space canvas and I want to know if over a world space canvas (which is OK) or if I am over a screen space canvas (in which case I ignore some input) I do not know how to do that!
    Without doing a full raycast at the current mouse position, can the EventSystem not tell me the object the pointer is over?