public void SetUp() { for (int i = 0; i < walkers.Count; i++) { DestroyImmediate(walkers[i].gameObject); } walkers.Clear(); for (int i = 0; i < numofdoods; i++) { Walker walker = prefab.Duplicate(transform.position + new Vector3(distance * i, 0, 0)); walker.transform.SetParent(transform); walkers.Add(walker); } }