# C# Rotate More than Two GameObjects

I’ve been trying to figure out a way more than two gameobjects from RotatingGameObjects. i and i + 1 should go through RotatingGameObjects.length and move all those gameobjects accordingly. but for some reason it rotates only the first two gameobjects within RotatingGameObjects. Is there a hole in my logic?

``````using UnityEngine;
using System.Collections;

public class RotateGameObjects : MonoBehaviour {
public float fDistance = 1;
public float fSpeed = 2;
public float sensitivity = 3F;
public GameObject[] RotatingGameObjects;

void LateUpdate () {

for(int i = 0; i < RotatingGameObjects.Length - 1; i++){
RotatingGameObjects*.transform.RotateAround(transform.position, Vector3.forward, - fSpeed / fDistance);*
``````
• `````` RotatingGameObjects[i + 1].transform.RotateAround(transform.position, Vector3.back, - fSpeed / fDistance);*
``````
• `````` }*
``````

}
}

void LateUpdate () {

``````     for(int i = 0; i < RotatingGameObjects.Length - 1; i++){
RotatingGameObjects*.transform.RotateAround(transform.position, Vector3.forward, - fSpeed / fDistance);*
``````

RotatingGameObjects[i + 1].transform.RotateAround(transform.position, Vector3.back, - fSpeed / fDistance);
}
}
I don’t quite get the point here:

1. you move the first guy forward and the second backward.
2. you move the second forward (back to 0) and the third backward
3. third goes forward (back to 0) and fourth move backward
As a result only the first and last are actually moving.