Hi, I have a need to be able to look at a game object that has just one C# script attached to it, I want to reference this script but depending on the object the script name will be different so I am looking for an old fashioned way of doing something like player.gameObject.GetComponent<“*.C#Script”>();
is this even possible? and does it make sense to anyone these days
The only answer I ever got to that question, was to make a parent class(doesn’t need to be in an object), and have the child class/es work like normal scripts. The one bonus of doing that is if many of the scripts all need the same variable, or call method, they each already inherit it so you don’t need to keep copy/pasting. Not sure if that’s what you’re looking for, but hopefully it helps!