Create Array Accessible By Any Script

Hello, this is probably a stupid question. But what I want to do is create some sort of Global Array that i can access from any script, because I made a grid and i need to add which grid segments i have clicked on to the array. Thanks if you know some way of doing this.

You could use a static variable:

public class MyClass
{
    public static bool[] MyArray;
}

public class MySecondClass
{
   void ExampleMethod()
   {
       MyClass.MyArray;
   }

}

So you can now access that variable from any script in your project by refering to the class name and then the variable name.
Hope that makes sense

The other option is using the singleton pattern:

public class MyClass
{
    public static Instance {get {return instance}}
    private static instance;
    public bool[] MyArray;

    void Awake(){
       instance = this;
    }
}
    
    public class MySecondClass
    {
       void ExampleMethod()
       {
           MyClass.Instance.MyArray;
       }
    
    }

You can find how to make a global (static) variable here. However, globals in general are frowned upon in programming so you might want to think about your overall program structure because of other data you want “global” access too.