Greetings Im trying to create a movement loop with 4 items.
I have the following code
void SwitchPositions()
{
tempPosition = parent.transform.GetChild(0).GetComponent<Transform>().position;
parent.transform.GetChild(0).GetComponent<Transform>().position = parent.transform.GetChild(1).GetComponent<Transform>().position;
parent.transform.GetChild(1).GetComponent<Transform>().position = parent.transform.GetChild(2).GetComponent<Transform>().position;
parent.transform.GetChild(2).GetComponent<Transform>().position = parent.transform.GetChild(3).GetComponent<Transform>().position;
parent.transform.GetChild(3).GetComponent<Transform>().position = tempPosition;
}
It runs fine until it completes the first circle then it just does the whole loop in 1 tick… Why?
Thanks.