public void AddFloor() { //instantiate prefab // gameObject floorGo = Instantiate.... Floor floorScript = floorGo.getComponent <Floor>(); floors.Add(floorScript); floorScript.AddPoles(); }