gdscript calling c# function gets squashed 1 dim array instead of 2 dim one

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Xetirian
public String[,] getStats(){
		String [,] stats = new String[stat_names.Length,2];
		for (int i = 0; i< stat_names.Length; i++)
		{
			stats[i,0] = stat_names[i];
			stats[i,1] = Convert.ToString(stat_vals[i]);
		}
		return stats;
	}

above the c# function in question. Function is called as usual via

object_instance.getStats()

The call returns [valA1, valA2, valB1, valB2] instead of [[valA1, valA2], [valB1, valB2]]

Have you tried an jagged array instead of an multidimensional array?

juppi | 2022-01-16 10:10

Hi, sorry for the delay.
Yes I have and in this case a list of empty Strings is received instead of the desired list of strings of strings.

Xetirian | 2022-01-20 16:11