Search Unity

PlayerSettings.forceSingleInstance not working on Ubuntu 16.04

Discussion in 'Editor & General Support' started by folmer_quiven, Jan 15, 2020.

  1. folmer_quiven

    folmer_quiven

    Joined:
    Jan 15, 2020
    Posts:
    1
    Dear Unity folks,

    I am trying to force a single instance of a unity application.
    On windows builds, the PlayerSettings.forceSingleInstance property is working great. When I try to launch a second instance it will instead focus on the instance that is already running.

    However, when I do a Linux build and try to run it on Ubuntu 16.04 I can still launch multiple instances. In the documentation I cannot find anything about this being a Windows only feature.

    Is there something I can do to make this work on Linux, or should I be writing my own script to emulate the same behavior on Linux?

    I have tried building with both Unity 2019.1.0f2 and 2019.2.17f1 (which is currently the most recent stable version if I am not mistaken). I have also tried this with a project I created from scratch, and I get the same behavior.

    Cheers
     
  2. Seathan

    Seathan

    Joined:
    Jul 31, 2017
    Posts:
    2
    Mine is not working in Windows 10, maybe I'm doing it wrong ? I got a script attached to a game object in my hierarchy and in the script I got the line below. I can run the thing in my editor and two other copies of the same .exe that I built and ran.

    PlayerSettings.forceSingleInstance = true;