x = EnemyObj as v;* This is what I have script wise... public object EnemyObj; public allEnemiesC getEclass; .... getEclass = this.GetComponent("allEnemiesC") as allEnemiesC; EnemyObj = getEclass.SelectedObj(type); if (EnemyObj.GetType() == typeof(pigClass)) //--- works { Debug.Log("Works"); pigClass w = EnemyObj as pigClass; //must cast to access members Debug.Log (w.eName); } else { Debug.Log("not working!"); } And I've sorta looked at generics, and invoke methods and was kind of hoping there was an easier way to do this. Also why do I need to recast this again if (EnemyObj.GetType() == typeof(pigClass)) is true? It feels like pigClass w = EnemyObj as pigClass; is redundant, but EnemyObj is just a Object that has the pigClass object passed to it... It returns an error if I skip casting of course, object does not have a definition blah blah... **So, my question is how can I cast to what the object is from getType?** *var v = EnemyObj.GetType();
x = EnemyObj as v;*