I’m using multi-dimensional arrays in unity, but running into some really strange problems with the size of the highest dimensions. Just check this out, maybe you have an idea why it’s happening?
Pardon the names, I tend to do that when I get frustrated. It seems that whatever I put in the last dimension when declaring the array get s ignored and whatever I put in the first dimension actually becomes the length of the last one. I tried using different data-types, same problem.
I guess, but in the script I litteraly have those two lines immediately after one another. I am running this in the ECS environment, but to my knowledge, it should not have an impact on array dimensions.
Thanks a lot for testing it on your end! This means that it must be something withing the midsts of my code which is messing things up for me.
I tested to see if I could make a script which simply creates the array and nothing else whatsoever. I still have the same issue. Here’s the entire code:
using UnityEngine;
public class Spawner : MonoBehaviour
{
void Start()
{
int[,,,,,,] myArray = new int[1, 1, 1, 1, 1, 1, 2];
Debug.Log("myArray Size = " + myArray.GetLength(6));
}
}
Also tested this in a new project without ECS packages, and it works fine in there. All I can say is that it could have something to do with the ECS packages.