I have a problem i do not understand with this code:
for (int indxFinal = 0; indxFinal < finalChangedCard_List.Count; indxFinal = indxFinal + 6) {
float finalX = float.Parse(finalChangedCard_List[indxFinal + 1]);
float finalY = float.Parse(finalChangedCard_List[indxFinal + 2]);
float finalZ = float.Parse(finalChangedCard_List[indxFinal + 3]);
float finalTWIST = float.Parse(finalChangedCard_List[indxFinal + 4]);
int finalSortOrder = int.Parse(finalChangedCard_List[indxFinal + 5]);
print ("X: " + finalX + " Y: " + finalY + " finalZ: " + finalZ);
dummyGO = GameObject.Find(finalChangedCard_List[indxFinal]);
print ("dummyGO.name: " + dummyGO.name);
dummyGO.transform.position = new Vector3(finalX, finalY, finalZ);
dummyGO.transform.localEulerAngles = new Vector3(0f, 0f, finalTWIST);
dummyGO.GetComponent<Renderer> ().sortingOrder = finalSortOrder;
}
Nothing is executed after this code that can change the positions. The output is:
X: 2.959876 Y: -1.832011 finalZ: 51
dummyGO.name: H8_1B
But the object “H8_1B” does not move to the position printed. I tested “dummyGO.SetActive(false)” and that worked???
Situation after the code is executed, position is still the initial one: