Hello,
I’m completely new to game development, but decently experienced in coding (python, web, pcb firmware).
I’m trying to create a simple 1v1 multiplayer game. So far I’ve accomplished the following:
- Created a Menu Scene, Lobby Scene, and Game Scene
- Created a basic working prototype of the playable game in the Game Scene
- Implemented the UGS Multiplayer widgets to create a session, view sessions (lobby), and join a session, by using the new widgets (Right-click hierarchy → Multiplayer Widgets)
- Get 2 players in separate instances (Using Multiplayer Play Mode) to spawn into the same session, with player movement synced
I’ve been struggling for days trying to figure out how to then load the “Game” scene, so the 2 players aren’t just floating around in the skybox. Currently, the player prefabs are instantiated when each player joins the session, and each player’s controls work. But they appear in the Lobby scene.
I’ve gone down several rabbit holes trying to figure out how to load the Game Scene for both players upon joining the session. I’ve dug into:
- Unity Events and triggering an OnClick event
- CustomWidgetsNetworkHandler.cs
- Loading the scene manually with a LobbyManager.cs script attached to the Lobby’s UI Canvas
None of this worked or feels right. And it feels like there’s a simple, right way to easily transition players into the Game Scene once they join the session, but for days I haven’t been able to discover it.
Is there an editable script somewhere that’s spawning the player prefabs on session join?
Any help would be greatly appreciated,
Thank you