- Home /
 
               Question by 
               panayiotismilios · Dec 21, 2018 at 05:08 PM · 
                tilemaptiles  
              
 
              How to set tile image fit tile size in a tilemap
Hi, I'm having trouble figuring out how to set my tiles images fit the tilesize of my tilemap. As you can see from the pictures below my tiles cover each other ( I left blank space on purpose). That's the code i use to place them: I was incrementing by one in my loops but the tiles images were covering each other even more. If i increment by 3 there's space between them. So what should i do to make them fit?
 for (int i = -500; i < 501; i = i +2)
         {
             for (int j = -500; j < 501; j = j + 2)
             {
                 if (i!=0 && j!=0)
                 {
                     terrainmap.SetTile(new Vector3Int(i, j, 0), grass);
                     
                 }
                 else
                 {
                     //terrainmap.SetTile(new Vector3Int(i, j, 0), notgrass);
                 }
                 
             }
         }
My tilemap: 
My tile: 
 
                 
                download.png 
                (335.3 kB) 
               
 
                
                 
                download2.png 
                (40.1 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                