Need help with Array

255p
255p
edited October 2018 in Photon Bolt
I have a problem to get the Array working, if another player joins and cant figure it out why.



My Array in states : ClothIndex = int[]

Script Part:




public int[] rmdCloth2;

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


for (int i=0; i< rmdCloth2.Length; i++)
{
state.ClothIndex[i] = rmdCloth2[i];
}


state.AddCallback("ClothIndex[]", ClothChange);

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

public GameObject[] ClothID;

public void ClothChange(Bolt.IState statee,string path,Bolt.ArrayIndices myArray)
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

INewState actorState = (INewState)statee;


for (int i =0;i<myArray.Length;i++)
{
ClothID[actorState.ClothIndex[i]].SetActive(true);
}


|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||



I hope that anyone can help me.

Answers

  • 255p
    255p
    edited October 2018
    All is working fine, if i play along, but it doesnt sync to other players.
  • Can you upload full script or project? It is a bit hard to read
  • Thanks for the answer :) I´ve solved the problem.