As I understand your project setup is like this, roughly:
![alt text][1]
![alt text][2]
[1]: /storage/temp/78234-capture2.png
[2]: /storage/temp/78235-untitled2.jpg
If you want to allocate a collection of waypoints to newEnemy's waypoint you need to do this:
newEnemy.GetComponent().waypoints = waves[currentWave].spawnPoints[2].GetComponent().waypoints;
In order to explain things, you are trying to cast a gameObject into array of gameObjects which will cause error. You need to reach a single spawnPoint's collection of waypoints and assign it to our newEnemy's waypoints.
So what you are doing was: trying to assign a GameObject into GameObject[] > gives error because its not covenient.
What you need to do: assign a GameObject[] into GameObject[] > like previous example I gave.
I hope this helps.
↧