- Home /
How to get Display.display[] to recognize a display other than Display.main?
I currently have two cameras for a scene in Unity 5.0.1 and I would like to set camera2 to render to a different display.
According to the Unity API documentation, whenever another display is connected to my computer, Display.displays[] should automatically update, but it is not doing that. Display.displays.Length always returns 1!
I know it is not my computer, because it detects the secondary display I connect (a projector) just fine and I am able to extend the displays.
So because Display.displays[] is not updating the number of displays I currently have (2), my script snippet (below) does not work, and my second camera renders I don't know where, but not on the projector.
public Camera cam2;
if(Display.displays.length > 1) Display.displays[1].Activate();
cam2.targetDisplay = 1;
Am I doing something wrong? Thank you for your help!