- Home /
uGUI clicks going into gameobject raycasts
Is it possible to have uGUI touch/clicks not to cause raycasts on gameobjects in the scene?
Does this help solve your problem? http://answers.unity3d.com/questions/467619/catch-gui-click-to-avoid-raycasting-after-a-click.html
No, the link you sent is OnGUI - which is a completely different system than uGUI.
Also, can you please don't abuse your close question power, especially if you don't understand the question? Thanks
i got round this by hovering a cube in front of the camera which is enabled when the gui is shown, its a bit hacky but it works as the cube captures the collisions ins$$anonymous$$d of the gameobjects. my cube covered the whole screen, but you could position it to just cover the gui elements. or perhaps just use a box collider with no renderer
edit: i havent used uGUI, so this may be totally irrelevant, sorry :(
I read in forums that GraphicsRaycaster seems to be a solution for earlier beta releases of 4.6 but I cannot get it to work(?) http://answers.unity3d.com/questions/845816/graphicraycaster-blocking-priority-ugui-1.html
I think there is an Checkbox in your Canvas, where you can say that your Raycasts should not go through uGUI Textures.
Your answer
Follow this Question
Related Questions
Holding down UI Button and shooting raycast from touch position doesn't work simultaneously:(( 0 Answers
How to select an object with TOUCH and change its animation 2D 1 Answer
How to touch select 3D objects 2 Answers
Casting a ray to detect the touched object in world space does not work 3 Answers
if ( Physics.Raycast ( ray, out hit, Mathf.Infinity, LayerMask ) ) not working? 2 Answers