variable = true from another script

hey, how do i activate a function using a true/false variable from another script?

var Shoot : ArrowControl = gameObject.Find("Arrow").GetComponent(ArrowControl);
if(Shoot.fire == true)
{
    Debug.Log("2");
    Fire();
}

  1. Get the object the script is on.

  2. From that object, get the component on it.

  3. On the component (Probably the script), set it equal to false/true. You have it right, just you aren't actually getting it from the target gameobject, I had this problem as well before.

I believe you can’t declare the object and components in the variable it self… That needs to be done in an update or other function