Question by
darkal · Nov 23, 2017 at 04:48 PM ·
gameobjectarraygetcomponent
Make script[] = gameobject[].getcomponet
spawnscripts[i] = spawns[i].GetComponent<NetworkSpawn>();
spawns = GameObject.FindGameObjectsWithTag("Spawn");
how can i make spawnscripts[] = to spawns[] gameobject script component
Comment
Not a question. You seem to have receive some error message which you decided to not include in your question. This is not a place to drop code fragments and wait until someone with a crystal ball comes along.
Also since it seems to be a debugging question / trivial basic program$$anonymous$$g problem it belongs to the Help Room and not the default space.
Best Answer
Answer by darkal · Nov 23, 2017 at 05:33 PM
never mind i figure out my issue i needed to resize the array to length of object array
spawnscripts = new NetworkSpawn[spawns.Length];
Your answer
![](https://koobas.hobune.stream/wayback/20220612143230im_/https://answers.unity.com/themes/thub/images/avi.jpg)