My current setup:
I have a game scene, rendered by a default 3d camera. All GUI elements are 3d planes with textures, rendered to the main window, with a secondary orthografic camera.
What I’d like to do:
I want to check if the mouse position is over any GUI element. Not all of them have colliders, so normal raycasting would fail.
My Idea:
Is it possible to use the fact, that the secondary orthografic camera only renders GUI elements and clears with depth? Can I use Rendertextures and check for alpha values at a given xy position, or would that be too expensive? If yes, is it possible to render a camera to the main window AND a render texture?
Thanks for your help!