I’m sure I’ve asked this type of question before, but I don’t think it was ever specifically about referencing to a script.
Basically, I have a prefab with a script, and I need to refer to that script’s variables for calculations and stuff for the script I’m working on.
I know the general idea of “GameObject.Find”, “GetComponent” and stuff like that. But I don’t think I’ve ever tried referencing another script directly. One time I somehow got away with just referencing the object, and then I was able to refer to its components’ variables. But I don’t remember anything about how I did it, or where (in which of my many scripts).
Here’s a simple explanation, because I tend to go off track:
Both scripts are on the same prefab.
I want one script to refer to the other, so I can use its variables.