I am pretty new to coding in c# with unity. I was wondering how you reference an GameObject varaiable from one script to another? I made the variable public but the other script cant find it.
To get a reference to another script on another gameobject you create a tag on the gameobject you wish to find the script attached to then use
ScriptName scriptName = GameObject.FindGameObjectWithTag("Tag Name").GetComponent<ScriptName>();
ScriptName is the name of your script you are trying to access and Tag Name is the name of the tag the gameobject the script is attached to has.
Or Alternatively if you only have one instance of the script in your scene you could use
ScriptName scriptName = FindObjectOfType<ScriptName>();