- Home /
Ignore(absorb) Raycast on Canvas in mobile
In Unity 4.6.1 we are trying to tap on a ui button and during tapping we are doing raycast . As a result the collider behind that ui button is detecting the tap .We want that the collider should not take tap when we tap on the ui button. we came across this solution but this doesnot work in mobile device (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject()) .This is for mouse over we need for mouse tap
Answer by SilentSin · Jan 15, 2015 at 01:41 PM
IsPointerOverGameObject should work on mobile devices, but it probably only checks the first touch contact.
Try using EventSystem.currentSelectedGameObject and checking if its null.
Your answer
Follow this Question
Related Questions
Erase Images on Canvas Using UnityScript 0 Answers
Instantiate Objects responsively [2D] 1 Answer
Screen record in unity3d 7 Answers
Applying damage with Flamethrower-like weapon 1 Answer
New Unity UI with OnTriggerStay. 0 Answers