I want to use a Script as a variable I can set in the Inspector.
var changeScript : nameOfScript;
This works, but I can only set “changeScript” to a script named “nameOfScript,” not anything else.
I need to be able to attach this to any Game Object and have it reference any other script also attached to the object.
If you want it to refer to any script on the object you can use this-
var changeScript : MonoBehaviour;
Unfortunately, you will only be able to use functions that are common to all MonoBehaviour, not the specific functions for each script, unless you cast it to a specific type-
var specificScript : nameOfScript = (nameOfScript)changeScript;
However, you can never be sure that ‘changeScript’ will be the correct type, so it would be better for you to define it specifically.
Why do you need to do this? There is almost certainly a better way.