- Home /
how to Ignore Raycast while GUI.Window showed
hi All, i was create a script to making clickToWalk to myChar, and then i use collider.tag "terrain" only. problem : while i create gui.window and add some button component, and i click button, myChar do walk to hit.point what cant i do for making ignore raycast while gui.window showed.??? + i was read about layermask, but im really newbie, so it make me confused.. :( thanks.
In your OnGUI, set a bool like windowOpen
In your raycast function, use a GetComponent to see if (windowOpen) and if it is return; (i.e. don't raycast)
using GetComponent it work, in case : window will open while trigger Enter, and window closed while trigger Exit. in Trigger, i cant 'clickToWalk' coz it was disable on triggerEnter. i dont know how to exit withaout destroy the object
I don't understand what you are describing. Without knowing more, you could maybe use the OnGUI Event handler to deter$$anonymous$$e if the mouse/click is in your WindowRect, and if so use it for GUI.Window and if not, use the click hit.point for raycast.
Your answer
