Could anyone help me? I need to create an array of objects that extend monobehavior. I tried simply using

var hull = partHull[16];

//and then calling

hull *= partHull(i, paikka, paikka5);*

in a for loop. But I can’t use new with monobehavior apparently? How would I do this?

You shouldn’t be creating new instances of ANYTHING that are derived from MonoBehaviour. A MonoBehaviour is class that relys on being attached to a GameObject. You should either be defining all 16 of the GameObjects then adding the partHull via AddComponent, E.g. THIS IS PSEUDO CODE - I’m not writing it for you. :slight_smile:

public GameObject[16] parts;

void Start()
{
    // iterate through each of the 16 parts
    FOREACH parts as part
    {
         // foreach of the parts, add the partHull component.
         part.AddComponent(partHull);

    }

}