Hello,
First of all, sorry if I make any mistakes, it’s not my mother tongue, and if my questions is silly.
With the new network system, I tried to do a little game that goes like this :
The player connects to the server, then pick up a hero, click on a button (“Go”) and can play.
But here is my problem : the first player connected will see the second player connected’s hero while the second player won’t see the first player’s hero.
I know that the fact that the first player see the second’s player hero is due to this command (when he clicks on the “Go” button):
public GameObject champ1;
public GameObject champ2;
[Command]
public void CmdChampSelected(int i)
{
switch (i)
{
case 1:
champ1.SetActive(true);
break;
case 2:
champ2.SetActive(true);
break;
}
}
i is the number of the selected champion.
And I don’t understand why it won’t do anything if I relaunch it with the first player.
The prefab of the player spawned by the NetworkManager contains the two champions, disabled, and one of them is unable when the player click on the “Go” button after making his choice.
I’m trying to understand all the [command], [SerializedField], [ClientCallback] thing so I maybe did a huge mistake in my code, but I can’t see where.
By advance, thank you.