Search Unity

Animated tiles in tilemap

Discussion in '2D' started by Health_Potion, Jul 15, 2019.

  1. Health_Potion

    Health_Potion

    Joined:
    May 30, 2017
    Posts:
    3
    Hello,

    Let's say I have a tilemap with a block of 50x50 tiles and right in the center is a single animated tile. Is it more efficient to place the animated tile in its own tilemap (only for animated tiles)? Does Unity have a way of optimizing one tile's animation without updating the whole map?
     
  2. Health_Potion

    Health_Potion

    Joined:
    May 30, 2017
    Posts:
    3
    This is general example. The specific use case will the surface waves of water within my entire level's art tilemap.
     
  3. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    283
    When the TilemapRenderer is set to Chunk mode, it will update a chunk (group of Tiles) when there are changes to Tiles in the chunk if the chunk is currently displayed on screen/s. This includes Tile animation changes. Other chunks without any changes will not be affected.

    If the TilemapRenderer is set to Individual mode, then the Sprite of each Tile is updated on its own but loses any optimizations made for rendering Tiles in a chunk.
     
  4. Health_Potion

    Health_Potion

    Joined:
    May 30, 2017
    Posts:
    3
    Thank you very much. I did not realize they had a chunk mode. Is there any reason why you would want individual rendering mode instead of chunk?
     
  5. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    283
    Individual mode will be for cases when you need each Sprite in a Tile to sort against other Renderers in the scene, especially when you expect certain Sprites to overlap.

    Chunk mode batches and renders groups of Tiles for speed, but will not be able to sort against other Renderers.