Basically, I want to create a generic script that I can attach to objects that, when activated, calls a function within another script. I want to be able to pick which script is used and which function is called just like a button, but without the button (My plan is to raycast when the player hits the interact input, check if the object that was hit has this generic script, and if it does, activate it). Obviously though I don’t want to create tons of copies of this script for each different object with unique functionality.
Here’s a picture of what I’m talking about:
I just want to be able to use that with my script.