PhotonNetwork.Instantiate returns always the same localposition
Options
Hello, I have a very strange issue and I don't know how to correct it.
I have an array in which I have different gameObect with different position in my screen. But when loop in my array and instantiate a new game object using the localposition of gameobject in my array, all new game objects instantiated have the same localposition : the first position in the array.
I have an array in which I have different gameObect with different position in my screen. But when loop in my array and instantiate a new game object using the localposition of gameobject in my array, all new game objects instantiated have the same localposition : the first position in the array.
for (int l = 0; l < 2; l++) { for (int c = 0; c < 8; c++) { //my positions are in this array position = Humain.plateauHumain[l, c]; //Position.transform.localPosition here are different for each element //I instantiate new gameobject using this previous position GameObject trou = PhotonNetwork.Instantiate(trouPrefab.name, position.transform.localPosition, Quaternion.identity, 0); //Position of trou here is always the same, the first position in the array. view = trou.GetComponent<PhotonView>().viewID; gi = trou.GetComponent<GestionInteraction>(); gi.MajPositionTrou(view, canvas.name, position.name, l, c); } }Please do you know how to correct it ?
0