void Update() { foreach (Transform child in transform) { if (state == 0 && child.transform.position.x >= rightBound) { state = 1; movementmanager.DownLeft(timeDown); } if (state == 1 & child.transform.position.x <= leftBound) { state = 0; movementmanager.DownRight(timeDown); } } }