Transform NewRock(Transform [] rocks, Transform[] track) { Transform transform1; int position = Random.Range (0, track.Length - 1); if (position < 46 || position > 113) { if (rocks.Contains (track [position])) transform1 = NewRock (rocks, track); else transform1 = track [position]; } else transform1 = NewRock (rocks, track); return transform1; }