Running script in project folder from script on gameobject, how?

Hey people, hope you can help me with this one :slight_smile: Im trying to minimize the amount of scripts i have on my player object, and therefor im instead trying to make a few “Manager” scripts that each handles 3-5 other scripts for each their field.

Ive tried :

  1. finding the scripts wiht tag and tagging them but turns up null.
  2. Done the usual c# script = new script() instantiation, null aswell.
  3. Skipped the drag script onto serialzied field method as i hate it when they sometimes miss there references and i gotta look trough a ton of folders and gameobjects to fitt it all together again. Also i prefer to have it down in code anyway.
  4. Tried the method where you create a “Resources” folder and put it there to use the Resourves.Load method, but i really dont like having to split various parts of my game up to use this Resources folder. My OCD compels me to keep the stuff together that belongs together.

Ps: Im still very new to Unity, used to use Monogame so bear with me im sure this is a silly easy question ^^

Ok a friend told me whats up! For anyone curious the solution(the best one) was:

private GridReader gridReader;
private GridCreator gridCreator;

void Start ()
{
gridReader = gameObject.AddComponent();
gridCreator = gameObject.AddComponent();
}

And this way i was able to acces my Grid classes and their content^^ Much better than any of those other ways i tried!

You want AddComponent() not new X() if you’re trying to attach a script to an object dynamically.

edit: too slow :hushed: