Multidimensional String Array doesn't work

Hi guys. I thought I created correctly a multidimensional stirng array, but from some reason it doesn’t print anything on the console. Any reason why?

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;

public class MyClass: MonoBehaviour {
    void Start () {

    string[,] myarray = new string[2, 2];
        myarray[0, 0] = "top left";
        myarray[0, 1] = "top right";
        myarray[1, 0] = "bottom left";
        myarray[1, 1] = "bottom right";
        Debug.Log(myarray[0,0]);
}
}

hmm… I tested your code and it works.

maybe you forgot to add MyClass to a GameObject in the scene?

Make sure the console buttons for printing log messages are selected.

–Eric

Yea, my bad, the script from some reason was deactivated in the inspector. It works. Thanks :slight_smile: