How interact on a GUI Texture in a scen with 2 cameras.

Hi Guys,

Here is my problem :

I’ve a scen with 2 Camera. So my screen is split. Everything is good.

I’ve a GUI Texture only visible on Camera 1. It is good.

My probleme is that I can’t interact on my GUI Texture. I’d like to open an external Link but it doesn’t work.

I 've the code that works great for the external link, but it works only when my scene has one camera.

Come one can help me ?

Many thanks.

Try creating your own HitTest() script, which grabs any applicable GUITextures from the scene and returns any of them that you clicked.

You can do this by grabbing the mouse position on screen upon clicking, and using the pixelInset and transform info of the GUITexture, figure out if the mouse click is within the bounds of the GUITexture and that the GUITexture has the highest Z value (for stacked GUITextures), and return it.

Then, you can have code that’s like

if (HitTest() == linkGUI)

etc etc.

Does this help?