Movement Loop

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.

I wouldn’t use script for that I would use the nodes that they have for the animations it way more efficient.