As I move the main camera in my Unity game towards the left or right, the camera just stops rendering any of the tilemaps in the scene.

Here, the camera is at x = 25.7, and the preview isn't showing anything (Neither is the game view), but as I move the camera inwards towards x = 24.7, everything renders normally...

I can clearly see the tilemap objects in the scene view though...


I found the problem! The camera doesn't render the objects even though they exist because the camera moves far enough away from them, to not render.

The Tilemaps I create are centered at 0,0 (even the ones that generate the tiles far away). So when the camera moves a certain distance away from them, it just stops rendering the tilemaps.

To fix it, I just had to centre the tilemaps closer to the place they would be generating their tiles (chunkNo * chunkSize).

This fixed the issue!

  • \$\begingroup\$ Thank you for answering your own question. Somehow Unity was setting impossibly low chunk sizes by default, even though my tilemaps are never far from zero; this answer helped immensely! \$\endgroup\$
    – kungphu
    May 8 '20 at 6:50
  • \$\begingroup\$ you can share your code ? please \$\endgroup\$
    – Qusdrok
    Dec 16 '20 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.