Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

Modify the playerPrefab before OnServerAddPlayer

$
0
0
Hi guys,

I'm trying to create a Login Manager for my game. I have 2 scripts : LoginManager.cs and CustomNetworkManager.cs (with a public GameObject playerGameObject).

From my LoginManager, I want to instantiate my playerGameObject
(networkManager.playerGameObject = Instantiate<GameObject>(networkManager.playerPrefab).

In my OnServerAddPlayer function i call the NetworkServer.AddPlayerForConnection with my playerGameObject.

But when I'm in game, the playerPrefab is deactivate. I tried to...

Modify the playerPrefab before OnServerAddPlayer

Viewing all articles
Browse latest Browse all 16796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>