Hi there!
I am trying to change the render camera to a 2 instantiated canvas’es.
I’m using Cardboard, and that’s why I’m trying to change these one’s, to make my own custon canvas in editor and then take this to the cardboard cameras, but I don’t know how to change the camera using C#
The code is this one:
public GameObject gCanvas;
public GameObject gCameraRight, gCameraLeft;
void Start ()
{
gCanvas.SetActive (false);
GameObject cRight, cLeft;
cRight = Instantiate (gCanvas) as GameObject;
cLeft = Instantiate (gCanvas)as GameObject;
cRight.SetActive (true);
cLeft.SetActive (true);
Canvas cL, cR;
cL = cLeft.GetComponent<Canvas> ();
cR = cRight.GetComponent<Canvas> ();
cL.renderMode = RenderMode.ScreenSpaceCamera;
}
Here is where I can’t continue, I want to acces to the render mode and change the camera, I can acces to change the render mode, but can’t acces to the camera on it.
Sorry if my english is bad ^^ I don’t know to speaking it wery well for the moment.
Thanks for the help ![]()