Question by
miniJosh · Apr 26, 2016 at 07:48 PM ·
prefabarray of gameobjects
How do i put an object in an array that's attached to a prefab?
Hi everyone, I'm kinda new to unity and very eager to learn. Right now i'm making a tower defense game. I have made an empty object to spawn my enemies from and i have made a movement script for enemies. The movement script works like this: the enemy is following different empty gameobjects. The gameobjects are attached to the script through an array.
My problem is: i cant set the gameobjects to the array, because my enemy is a prefab.
These are the scripts i made.
Help is greatly appreciated :)
enemyscript.png
(21.3 kB)
enemyspawnscript.png
(16.9 kB)
Comment