This works
var sword : GameObject;
character.GetComponent(equipment).Attach(equipmentList.sword);
This is what I want to do
var sword : GameObject;
var item : String = "sword";
character.GetComponent(equipment).Attach(equipmentList.item);
How can I pass a variable for the name of the item? Attach() expects a GameObject but I need item to be a string.