Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: daniellogin on April 24, 2019, 12:09:32 AM

Title: Dual monitor 2 player - A camera for each monitor?
Post by: daniellogin on April 24, 2019, 12:09:32 AM
I have two monitors hooked up on this computer. I'm playing around making a 3rd person game and considering adding 2 players. I hate split screen though, so don't think I will bother unless I can get it so each player has their own monitor.

So just to be clear, I want to use two monitors, but I don't want it to be spanned across both monitors. I know how to do that with Nvidia and it's easy, but what I want to do is have a camera for each player, and each camera plays full screen on it's own monitor.

How?
Title: Re: Dual monitor 2 player - A camera for each monitor?
Post by: daniellogin on April 24, 2019, 03:47:40 AM
Ok I did a quick test with this script I found and it seems to work:

Code: [Select]
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class multi_display : MonoBehaviour
{
    // Use this for initialization
    void Start()
    {
        Debug.Log("displays connected: " + Display.displays.Length);
        // Display.displays[0] is the primary, default display and is always ON.
        // Check if additional displays are available and activate each.
        if (Display.displays.Length > 1)
            Display.displays[1].Activate();
        if (Display.displays.Length > 2)
            Display.displays[2].Activate();       
    }
    // Update is called once per frame
    void Update()
    {

    }
}

That script enables up to 2 screens.. or is it 3? I dunno. It checks how many it needs though.

Using that and setting the first camera to Display 1 and the other to Display 2 works, but only in the build, not in the preview.
Title: Re: Dual monitor 2 player - A camera for each monitor?
Post by: djaydino on April 25, 2019, 02:34:08 AM
Hi.
Thanks for sharing this!

i actually can use this in one of my arcade projects!

I will make a PlayMaker action/version of this.

i also did some research and indeed this can only work in a build.

But you can see the different displays by selecting them (top left game window)

i also found this unity post :
https://answers.unity.com/questions/1131106/possible-to-change-display-and-update-resolutions.html

So maybe i can make an action to make it possible to swap display @ runtime
by (for example) pressing a button.

pls bump if i did not reply with some actions by next week :)
Title: Re: Dual monitor 2 player - A camera for each monitor?
Post by: daniellogin on May 04, 2019, 09:55:08 PM
pls bump if i did not reply with some actions by next week :)

Bumped, if you are still interested in making some actions.
Title: Re: Dual monitor 2 player - A camera for each monitor?
Post by: djaydino on May 11, 2019, 08:37:25 AM
Hi.
Sorry i had a hectic week, i will try to make them this week.