- Home /
How to create a button that doesnt render in the main camera?
Hello
i have 2 cameras, the main camera and camera1. I need to show the button in the camera 1 but when i start the game it appears anyways in the main camera.
PD: I disabled GUIlayer from the main camera but it doesnt work.
thank you :)
Comment
Answer by Maui-M · Jan 29, 2014 at 11:58 PM
Try one of the following:
function OnGUI () {
if(Camera.current != Camera.main){
//Render GUI
}
}
function OnGUI () {
if(Camera.current.name == "camera1"){
//Render GUI
}
}
Answer by mitos · Jan 30, 2014 at 03:27 AM
Tyvm :)
Please don't pose comments as answers.
Rather you should check his answer as accepted.