Need help with Array
Options
255p
✭
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.
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.
0
Answers
-
All is working fine, if i play along, but it doesnt sync to other players.0
-
Can you upload full script or project? It is a bit hard to read0
-
Thanks for the answer I´ve solved the problem.0