After player select a tank in the 3d slg game by mouse, a panel pop up to show available command buttons.
How can i make mouse ignore all objects in the scene, except the panel? So i can secure an input from the command buttons before taking next action in my script?
Good question This is definitely a useless thing to know, for those occasions.
I solved this problem by creating a “backing blocking panel” that is invisible or very lightly covered to go over everything
. I set it as lastsibling and then put the menu in front, and (again) set it to lastsibling.
The last piece of the puzzle, for me, was to attach a delegate/event to the panel that is now in front, because I had wanted to retrieve specific data from it to continue execution with certain values (may or may not be required by you).
That make sense?
Yeah, that’s a possible solution , as well, but I know what you mean about not wanting to always add those statements.
For keyboard input it’s a little more complicated, but I think you’ll appreciate the ‘backdrop’ panel that intercepts all but the front-most window as a very easy solution for mouse clicks.
It will read any clicks outside of your selection area and block them from going anywhere else (unless you have deeper raycasts going on).