Search Issue Tracker

By Design

Votes

0

Found in

2017.3.0f3

Issue ID

1009970

Regression

No

TileMap.size does not change when the tiles are erased

2D

-

How to reproduce:
1. Open the attached Unity project named "Tilemap size".
2. In "Tile Palette" window press "Paint with active brush" button. Paint some tiles in the scene.
3. Press Play. Check tilemap size.x and size.y values in "Console" window.
4. Exit Play mode.
5. Erase edge tiles or all tiles.
6. Press Play. Check tilemap size.x and size.y values in "Console" window.

Expected result: Tilemap size is lesser after erasing the tiles from the edge. Tilemap size is 0 when erasing all tiles.
Actual result: Tilemap size does not change when the edge tiles or all tiles are erased.

Reproducible with - 2017.2.0a4, 2017.2.2p1, 2017.3.1p4, 2018.1.0b10, 2018.2.0a4

Note:
In the 2018.2.0a3 version of Unity, the tile is not seen in "Tile Palette" window, but you can still draw it.
Tilemap was first introduced in 2017.2.0a4, so no older versions could be tested.

Resolved by design:
The size of the Tilemap represents the largest bounds which was previously covered by the Tilemap. For performance reasons, erasing tiles does not automatically reduce the size of the Tilemap.

To ensure that the size of the Tilemap represents the actual bounds of the Tilemap, the user should run Tilemap.CompressBounds() through scripts or from the Tilemap component settings menu "Compress Tilemap Bounds".

Comments (6)

  1. RVDH

    Aug 10, 2021 18:41

    Also ran in trouble in the 2021 version and ate the frog and reverted my project to the prev version to get rid of the resultant side effect. The reason was not visible. Quit hard to fix the boundaries of overlaying tilemaps when you can not see the reason for a none shrinking boundariers by removing something.
    At runtime keep the boundaries after removing. But at designing in the editor refresh the boundaries!
    Okay, now it need to call this CompressBounds function of the balanced tilemaps before creating my meta data parallel array. You should display a hint in the editor about the CompressBounds option and importance!

  2. ShiningMichal

    Oct 17, 2020 09:04

    2020.1.6f1 still not working

  3. Jakems

    Aug 10, 2020 10:53

    Still happening in 2019.3.5

  4. spawn_thrasher

    Jan 17, 2020 02:33

    Still experiencing this in 2019.2.11f1

  5. lmggamestudio

    Mar 25, 2019 00:36

    Experiencing this in 2018.3.9f1

  6. asdaDAS

    Jan 23, 2019 04:04

    Experiencing this in 2018.2.17f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.