void SetupWanderScripts() { wanderScripts = new Wander[points.Length]; for (int i = 0; i < points.Length; i++) { Wander w = points[i].gameObject.AddComponent <Wander>(); w.Initialize(wanderSpeedRange, timeBetweenDirectionChangeRange); wanderScripts[i] = w; } }