- Home /
how to customize gamePlayer in unet
hello guys i have a simple annoying problem. what i am trying to do is...
i am making unet game that has a lobby and game scene.
in Lobbyscene, each player chooses team(red/blue).
and when initiating gameplayer i tried to customize players to set team. but it never worked in any clients except server(host).
here is my code that initiating gamePlayer
public override GameObject OnLobbyServerCreateGamePlayer(NetworkConnection conn, short playerControllerId)
{
StSelect info = ChampionSelectLobby.instance.curPlayerSelectChampDic[conn.connectionId].Value;
Vector3 spawnPos=Vector3.zero;
switch (info.team)
{
case EnTeam.Red:
spawnPos = startPositions[0].position;
break;
case EnTeam.Blue:
spawnPos = startPositions[1].position;
break;
}
GameObject character =Instantiate(spawnPrefabs[(int)info.champ], spawnPos, Quaternion.identity);
character.GetComponent<AllianceDecider>().SetTeam(EnTeam.Blue);
return character;
}
i know this code won't work as it is. i think i tried every ways i found in google, but still stumbling would be very thank for any suggestions. cheers.
Your answer
![](https://koobas.hobune.stream/wayback/20220612152804im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make GUI update for all players in a networked game? 1 Answer
UNET Multiplayer Lobby not creating an instance of the lobby player 1 Answer
Lobby - Trouble with custom feature 1 Answer
UNET: Lobby players not spawning on joining client 1 Answer
Online multiplayer. 1 'main-world' & smaller ones. 0 Answers