- Home /
Question by
madfatcat · Feb 01, 2017 at 07:29 PM ·
networkingnetwork.instantiatenetworkplayer
UNET Networking: where and when to initialize instantiated player on the client?
In my game, for every connected client, player object is instantiated automatically by NetworkManager. I'd like to perform some initialization stuff (tie up some functions to player events etc) on the client side for localObject only. Where should I do this? I overridden NetworkManager's OnClientConnect function, but NetworkConnection's playerControllers list is empty at this moment and ClientScene.localPlayers[0].gameObject is null, so I don't have a reference to the player object in this function cause it is not spawned yet. How to handle such initialization on the client?
Comment
Your answer
Follow this Question
Related Questions
UNET Client wont update varsync 0 Answers
Help me please with Unity Multiplayer 1 Answer
UNet Network Transform not Sync 1 Answer
Network, Builds wont move 1 Answer