Ok so I’ve run into a problem, I have a array that holds a bunch of different enemy types and instead of instantiating and destroying them I’m gonna just activate/deactivate there renderers and AI scripts, the problem is, is that different enemies have different AI scripts with different names, but theres only one script attached to each enemy so is there some way to say like
anyscript = enemy[x].GetComponent[anyscript];
anyscript.active = false;
where anyscript stands for whatever script is on the gameobject but isn’t called by name? so basically I need to be able to disable/enable the script without calling it by name or anything. is there a way to do that?