-1

I'm having some trouble creating a 2D array game object.

I would write in Java

Gameobject[][] gameobjects= new Gameobject[x][y];

As far as I know, c# is based on Java and much works like in Java. But I'm having some troubles when creating a 2D array gameobject because it shows me an error in the second dimension parameter

I couldn't find anything about my problem on YouTube, so I hope you can help me.

derHugo
  • 83,094
  • 9
  • 75
  • 115

1 Answers1

2

https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arrays

So, for your case...

Gameobject[,] gameobjects= new Gameobject[x,y];
Guye Incognito
  • 2,726
  • 6
  • 38
  • 72