I’m working on a multiplayer game and I’m having some issues when activating or deactivating GO’s that are already in the scene.
I have a list of levels in the scene and they are all deactivated when the players enter the game.
Depending on the level they are in. That level should be activated. The server decides where they are in the level. On server side everything looks normal but the client never see the levels being activated so they stand on a blank space. All the objects that are instantiated with the ‘spawn’ function work as intended but the environment doesn’t show.
If I’m not mistaking, this code should do the trick? This code gets run on the server and should activate the level on all clients. Does anyone know what could fix this issue?
The CmdSetActive gets called on the start of each level.
Commands are used to call a method on the server with a request from the client. If you’re running this from the server already, why call a Command? Also, Unet does supposedly support sending GameObjects as parameters of an RPC so long as they are spawned with network identity components, but I’ve never seen that actually work correctly. I’d send another identifier and find the correct level GameObject on the client based on that identifier.