peterdrake,
@peterdrake@qoto.org avatar

I'm trying to learn to develop multiplayer games in Unity, using the project from Binary Lunar's excellent tutorial:

https://www.youtube.com/watch?v=HWPKlpeZUjM

If I simultaneously run a local build on my machine (which happens to be a Linux box) and run the game within the Unity editor, I can create a host in one and a client in the other. They play together happily.

I also made a MacOS build and downloaded it on a separate machine. I can run the game there and create a host.

Strangely, if I then try to create a client from the other machine (either the local Linux build or within the editor), I get this message:

[Netcode] Cannot start Host while an instance is already running
UnityEngine.Debug:LogWarning (object)
Unity.Netcode.NetworkLog:LogWarning (string) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.6.0/Runtime/Logging/NetworkLog.cs:28)
Unity.Netcode.NetworkManager:CanStart (Unity.Netcode.NetworkManager/StartType) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.6.0/Runtime/Core/NetworkManager.cs:697)
Unity.Netcode.NetworkManager:StartHost () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.6.0/Runtime/Core/NetworkManager.cs:830)
NetworkUI/<>c:<Awake>b__4_0 () (at Assets/Scripts/NetworkUI.cs:20)
UnityEngine.EventSystems.EventSystem:Update () (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:530)

This only happens if there is an instance running on the Mac!

Of course, the only time you would want to create a client is if there is another instance (a host) running. It's as if the game running on the Mac and the one running in the Unity editor think they're the same program, and therefore refuse to make a "second" network connection.

What can I do about this?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • unity
  • DreamBathrooms
  • InstantRegret
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • modclub
  • Youngstown
  • ngwrru68w68
  • slotface
  • osvaldo12
  • kavyap
  • mdbf
  • thenastyranch
  • JUstTest
  • everett
  • cubers
  • cisconetworking
  • normalnudes
  • Durango
  • anitta
  • khanakhh
  • tacticalgear
  • tester
  • provamag3
  • megavids
  • Leos
  • lostlight
  • All magazines