- Home /
Question by
Discovery · Jan 14, 2012 at 05:02 AM ·
javascriptinstantiatetransform
Instantiating a prefab question
Hi there, so, im trying to create a very simple tower defense game, i've got some stuff up, but by now im doing the spawn system, i wrote a code for waypoints which uses Transform attachment, thats the prefab options, but i cannot add any object to it! And without it, my waypoint system does not work! How can i attach an object to it?
Thanks
Comment
Answer by aldonaletto · Jan 14, 2012 at 05:07 AM
You should post your script, so we could check what may be wrong. Anyway, if you declared a Transform array, you must set its size in the Inspector to be able to drag any object to it:
var waypoints: Transform[]; // define the size in the Inspector!