CS0266 cannot convert type 'object' (which actually is a argument of type int[,]) to 'int[,]'

Hello everyone! i’ve got a bit of a struggle with the following function:

int[,] SmoothMap(int[,] map, int amount){
		int[,] TempMap = map.Clone ();
		for (int StupidVar=0; StupidVar<amount; StupidVar++){

			for (int x = 0; x < LevelSize; x++) {
				for (int y = 0; x < LevelSize; y++){
					Delidding(map, x, y);

		return TempMap;

Unity throws out the error for line 2

error CS0266: Cannot implicitly convert type `object’ to `int[,]'. An explicit conversion exists (are you missing a cast?)

It thinks that the argument is not off type int['], but of type ‘object’. How can i fix this?


int[,] TempMap = (int[,])map.Clone ();

Fixed it. This tells the compiler map will be off type int[,] which is a bit weird, because map is already declared as int[,] (and yes i have to say that, because it annoys me).