I making a simple game for practice. I have 2 cube like 2 player. I generate a random number this is the name of the cube. I store this numbers in an array and i have not got problem with this. But when i made my game multiplayer i get some issue cuz when i join the second player i think the game regenerate the first player's number... this you can see on the picture! And this is the script which generete and add the number to name. And this script attached to the player prefab.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class PlayerThings : NetworkBehaviour {
public int player_name;
public GameObject Number;
void Start () {
player_name = Random.Range (10, 99);
this.name = player_name.ToString ();
GameManager.numbers [player_name] = 1;
Number.GetComponent<TextMesh> ().text = name;
}
// Update is called once per frame
void Update () {
}
}