I’m trying to add a component to a GameObject by passing a string to it.
GameObject newGO = new GameObject();
string supportCardType = "mySupportCardType";
Type newType = Type.GetType(supportCardType);
newGO.AddComponent<newType>();
This doesn’t compile because: ‘newType’ is a variable but is used like a type.