Home > OS >  How can i access the local player's Network object?
How can i access the local player's Network object?

Time:01-11

I tried NetworkObject ClientObject = NetworkManager.Singleton.ConnectedClients[clientId].PlayerObject; but it didn't work because only the server can access "ConnectedClients"

I'm using the new NetworkManager from "NetCode For GameObjects" it spawns the players for me, I'm trying to find a way to get the local player's object through code without having to spawn the player myself...

here is the documentation I'm looking at.

CodePudding user response:

The best solution to this would be to write your own protocol to send and receive DATA. You can't use Rpc because the unity solution is VERY Buggy and will not most work of the time. they are using UNet (2015 version) with the new 2021 network manager and most of the stuff there just can't work together without being rewritten, so my suggestion is to just leave the network manager or write your own protocol.

another solution to this that would probably work the best is to learn and use Proton, but that may take some time. its the only supporting helper.

  •  Tags:  
  • Related