I follow the tutorial 2D Roguelike tutorial. I want to understand how happen that 10x10 board of 32x32 sprites covers screen perfectly? Like what does this depend on?


1 Answer 1


This depends on several things really.

First is the pixels per unit found in the sprite editor, which determines how many pixels there are for each 1 of Unity's distance units. So if you want your 32x32 sprites to be at 1,1 1,2 ect with no overlap, this should be listed as 32.

Next is the settings on the camera, which show a certain amount of the game world. For a 2d game, Orthographic is probably best. The size setting is what determines how many units the camera displays, being half of the size of the vertical viewing volume (horizontal comes from the aspect ratio).

Finally, there is the scale on the object itself. This is the multiplication of a single run. So if the object is 1 unit long, a scale of 2 would increase it to 2.

On another note, with regards to roguelikes, the more modern way to make them which that tutorial is too old to mention would be a tilemap. In this case, another value to be concerned about would be the cell size, which determines where in the world the tile is placed. A cell size larger than the tiles pixels to units will result in gaps between tiles, and a cell size smaller than the pixels to units will result in overlapping.

  • \$\begingroup\$ The 'size' camera property is what i missed from the beginning. \$\endgroup\$
    – mirt
    Commented Jul 12, 2018 at 17:20
  • \$\begingroup\$ Not surprising, since it is hidden unless on Orthographic mode, and IIRC, even in 2d, the camera is by default in Perspective. \$\endgroup\$ Commented Jul 13, 2018 at 11:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .