I am using Multiplayer Play Mode to replace our old way of using ParrelSync to have a client-hosted game join two players in a match through a relay server (Nakama).
So far, so good. But I’ve run into an issue. When both players should move from the Startup/Connection scene to the actual game scene, only one client does this. The other throws an error saying the scene can’t be located and it should be added to the game’s Build Profile. Depending on which client is the first one to load it always affects the other, so it can happen to either the Main editor window or the additional player window.
For additional info, I’m not doing anything complicated with the Nakama game server. It is merely creating a match at this point and nothing else. After the match is created, each client is loading the new scene async, replacing the existing one.
Anyone else run into this or know why the other client wouldn’t be aware of the scene despite it being a part of my default scene list in the Build editor? Is there some extra bit of info I need to provide to the Multiplayer Play Mode settings?
Thanks!
-A
Hello, if I understand the problem correctly, the error could be that the server, in this case the client host, should move all clients or send a “command” to move the scene. If the client does this locally it could cause problems depending on how you implemented it. Maybe you could share the code, that is performing the scene change?
Yikes. I forgot I posted this. One of our team members figured out what was going on, and it didn’t have anything to do with Multiplayer mode.
Sorry if I took up people’s time.
What was the solution you all ran into? I’m having this same issue on a sample project I started up, and I see nothing wrong in the setup.
It was a conditional issue triggering a scene load that was specific to our connection logic.
However, we ran into the issue again about a week later, and that time it was related to Multiplayer mode.
There are some situations such as adding scenes to the build, library changes, etc., that a virtual player client will seem to recompile and not throw up a warning, but they fail as if something was wrong with your code. In these cases you should always untick the virtual player(s) off and back on to have them completely re-build. If that doesn’t work, re-start the entire project.
This might be a situation Unity is aware of and will improve in the future, but I’ve run into it several times now when updating a critical library. The virtual player goes through a compilation step like the main editor window, but for some reason it’s like it is still using the previously working set of dependencies before your manifest.json changed.
Hope that helps!
1 Like