- Home /
Dual Monitors and the new Target Display from 5.3
I would like to create a split screen game with two monitors. The new function "Target Display" is supposed to let me choose what display I want to use for which camera. With the documentation I have found online I could not get it to work and I was wondering if someone knew why. My setup contains two players with two camera's set to display1 and display2. The code that I have in an empty Game Object is as following:
using UnityEngine; using System.Collections;
public class AddMonitor : MonoBehaviour {
// Use this for initialization
private void Awake()
{
if(Display.displays.Length > 1)
{
Display.displays[0].SetRenderingResolution(1680, 1050);
Display.displays[1].Activate();
Display.displays[1].SetRenderingResolution(1680, 1050);
}
}
}
Unity Documentation of Target Display: http://docs.unity3d.com/Manual/MultiDisplay.html
I've tried some 'hacks' I found on the forum however it only works windowed. As the function is quite new, I have not found a lot about it. Also, I am working on OS X.
Thanks in advance,
Nikki
Answer by EvalDaemon · Oct 14, 2016 at 06:42 PM
Even with the pro version (5.4.1) I get this on windows 10 when running the project in the editor. However doing a build and running the build returns the proper results. Here is my quick hack, where I hardcode in the number of my monitors which is 3 for the editor version.
monitor_count = Display.displays.Length;
#if UNITY_EDITOR
monitor_count = 3;
#endif
#if !UNITY_EDITOR
for (int i = 1; i < monitor_count; i++)
{
Display.displays[i].Activate();
}
#endif
Your answer
Follow this Question
Related Questions
Is it possible to switch monitor on a Mac? 0 Answers
UGUI Scaling across multiple monitors 0 Answers
Mutli Display doesnt update? 0 Answers
Play 2 Stand Alone Players At Same Time 1 Answer
My multi-monitor support is broken. How can I fix this? 2 Answers