{"id":1197,"date":"2016-04-07T23:58:59","date_gmt":"2016-04-07T23:58:59","guid":{"rendered":"https:\/\/www.appsfresh.com\/blog\/?p=1197"},"modified":"2016-04-08T01:09:21","modified_gmt":"2016-04-08T01:09:21","slug":"multiplayer","status":"publish","type":"post","link":"https:\/\/appsfresh.com\/blog\/multiplayer\/","title":{"rendered":"Run multiple players in Unity"},"content":{"rendered":"<p>When you create a multiplayer game in Unity, testing can become quite a pain in the neck because you need to have at least 2 players running at the same time to try out multiplayer functionality, just like if 2 players where running the game each one on their own computer.<\/p>\n<p>The is no other way to test Unity UNET networking unless you create a host server game and a client game running in parallel.<\/p>\n<p>Luckily, the AppsFresh.com team has made a Unity script that will simplify your life as you can build and run 2 to 4 Unity players simultaneously, just by dropping the\u00a0<a href=\"https:\/\/www.appsfresh.com\/blog\/wp-content\/uploads\/2013\/10\/MultiplayersBuildAndRun.cs\">MultiplayersBuildAndRun.cs<\/a> file in your assets folder. Create an Editor folder within the assets folder if you don&#8217;t already have one there. Then drag and drop the <a href=\"https:\/\/www.appsfresh.com\/blog\/wp-content\/uploads\/2013\/10\/MultiplayersBuildAndRun.cs\">MultiplayersBuildAndRun.cs<\/a>\u00a0file in that folder.<\/p>\n<p>You can now go to the Unity menu, under &#8220;File&#8221;, you will find the &#8220;Run Multiplayer&#8221; sub menu item then select windows or MAC OS and select the number of concurrent players you&#8217;d like to test.<\/p>\n<p>This is it! This is a huge time saver when it come to trying out Unity3D&#8217;s UNET multiplayer features.<\/p>\n<p>Enjoy!<\/p>\n<p>Here is the <a href=\"https:\/\/www.appsfresh.com\/blog\/wp-content\/uploads\/2013\/10\/MultiplayersBuildAndRun.cs\">file<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=v8nIr3FgWIc\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1200\" alt=\"run-multiplayer-unity-unet\" src=\"https:\/\/www.appsfresh.com\/blog\/wp-content\/uploads\/2016\/04\/run-multiplayer-unity-unet.jpg\" width=\"800\" height=\"450\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you create a multiplayer game in Unity, testing can become quite a pain in the neck because you need to have at least 2 players running at the same time to try out multiplayer functionality, just like if 2 players where running the game each one on their own computer. The is no other [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1197","post","type-post","status-publish","format-standard","hentry","category-app-development"],"_links":{"self":[{"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/posts\/1197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/comments?post=1197"}],"version-history":[{"count":3,"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/posts\/1197\/revisions"}],"predecessor-version":[{"id":1201,"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/posts\/1197\/revisions\/1201"}],"wp:attachment":[{"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/media?parent=1197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/categories?post=1197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appsfresh.com\/blog\/wp-json\/wp\/v2\/tags?post=1197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}