Search Unity

Running two instances of Unity simultaneously to debug network code

Discussion in 'Multiplayer' started by thecowhunter, Nov 7, 2011.

  1. thecowhunter

    thecowhunter

    Joined:
    Nov 7, 2011
    Posts:
    1
    Hello

    Myself and Edd Smith (Origami Blue) found an easy way to run two instances of unity on the same project, which is useful for writing network code. Apologies if this was already posted somewhere (we didn't find it anywhere). This worked fine for us on Unity v3.4.2.

    The solution involves duplicating the project to another folder while linking the Assets so that both projects use the same scripts etc. First we recommend the following changes to the settings - switch "Show Project Wizard at Startup" on (Edit/Preferences../General), and make the player run in the background so that both instances will run simultaneously (Build Settings.../Player Settings.../Run In Background).

    Make a copy of the top level unity project folder to another location. However, instead of duplicating the assets folder, use a symbolic link:

    Code (csharp):
    1.  
    2. cd <duplicated_project_folder>
    3. mklink /D Assets <original_project_folder>\Assets
    4.  
    Then start a second copy of unity and direct it to the duplicated project. You can then make changes to scripts and click both editors and it will rebuild code.

    Note that since a copy of the project settings has been made, changes to project settings will not be applied across (although the settings files could probably be symlink'd as well).

    Huw Bowles/West Pier Studio
    Edd Smith/Origami Blue
     
    Last edited: Nov 7, 2011
  2. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Or just use uCollab )).
     
  3. NeeravM

    NeeravM

    Joined:
    Jul 9, 2013
    Posts:
    4
    Thanks a lot for this tip. It has saved me a lot of time in network debugging. I am trying to do this with webplayer as a platform, and somehow this seems to fail. It works well for standalone though.
     
  4. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,124