Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

4.6 uGUI not blocking rays on touch device(android)

Discussion in 'UGUI & TextMesh Pro' started by battleAxeBlues, Nov 6, 2014.

  1. battleAxeBlues

    battleAxeBlues

    Joined:
    Nov 6, 2014
    Posts:
    1
    Hey There,

    I have a UI setup for my game and have been testing initially on windows, so i have drag and drop enables and this all works well, I can click on the ground and my player will walk there, If I click on a GUI element, then the gui blocks the ray and as expected the player doesn't move the area under the GUI, however on android, the GUI isn't blocking the rays cast from touches.

    Is there some specific code to use for touches as opposed to clicks (I'm using the EventManager.current.OnClickOnGameObject() -- could be a typo there -- recalling from memory... i this returns false then I call the ray for navigation ).

    So when I do this on android, although all my drag and drop code works fine, when ever I start a drag on a UI element, the player starts to move which isn't desirable..

    Any I missing something very obvious?

    Thanks in advance for any help!