10-23-2024 09:13 AM
Hello everyone, I'm working on a PC VR multiplayer experience where the PC acts as the server/host character, and the VR players are clients. I'm using Unity's Netcode for GameObjects (NGO) for networking.
Here's my setup and issue:
Setup:
The PC is the host and the VR players are clients.
I have a custom scene management script here:Custom scene manager script
All core game objects (Network Manager, Meta Networked Avatars, Scene Manager, an object spawner that is just a gimmick to drop little cubes), VR Rig, Players, Arduino manager(I'm using Uduino I'm fairly certain this is not the issue)) are set to Do Not Destroy On Load.
Scene Management is enabled on the Network Manager.
All network game objects in the second scene (indexed as Scene 1) are registered in the Network Prefab List in the Network Manager.
The Problem:
When I switch scenes (from the initial scene to Scene 1), the network objects don't sync properly:
In the Editor (PC host), I only see a Spawn Button in the NGO component, and clicking it doesn't seem to help.
The NGO component is visible on both the host and the client, but they are not synced after the scene switch.
Everything works perfectly in the initial scene; the issue only occurs after the switch to Scene 1.
I have an object spawner that drops grabbable cubes on input that is set to do not destroy from scene 0, is cubes are spawned in scene 1 these are synced.
What I Need Help With:
Is there something specific I’m missing with the scene change setup for NGO?
Do I need to do anything additional when switching scenes to ensure that all network objects stay synced?
Any guidance or suggestions would be greatly appreciated. Thanks in advance!