Bolt array not working properly - what am I doing wrong?

Pecek
Pecek
edited October 2016 in Photon Bolt
I'm trying to synchronize an array like this
foreach(myObj obj in myObjList)
{
....state.myArray[obj.index] = obj.myValue; //obj.index and obj.myValue IS correct
}
so far so good, in the bolt inspector the values are synchronized just fine. However, when I try to iterate through them manually I get completely wrong values - and I have no idea why. I'm looping through the array like this
for (int i = 0; i < state.myArray.Length; i++)
{
....myValues += "[" + i.ToString() + "] " + state.myArray[i].ToString() + "; "; 
}
GUI.Label(new Rect(160, 10, 300, 150), myValues);
now, the weird thing is this way it looks like every value is shifted. The first element will become the third, the second the sixth, and so on - and the rest will remain at 0 all the time. I really have no idea why is this happening, at first I thought I might messed up the indexing but that isn't the case, and in the bolt entity inspector the values are 100% correct, seems like state.myArray[index] not returning the correct values. I'm using 0.4.3.17. Can you guys help me?

Comments