Unity-Technologies/2d-extras

Tilemap renderer cannot be refreshed after deletion

Himil88 opened this issue · 2 comments

hello.

I wrote a script to delete a tile at a specific location at runtime.

The deletion and tilemap collider refresh worked fine, and I even saw it in the editor.

However, I was having an issue with the renderer not automatically refreshing, leaving the tiles in place.

I tried using Tilemap.RefreshAllTiles(), Tilemap.RefreshTile, and turning the component off and on via script to update the renderer that wasn't cleared, but I couldn't resolve this issue.

The only way was to turn the component off and on directly in the editor.

Unity version: 2023.2.0b16
2D Tilemap Extra version: 4.0.2
Code for delete a tile: Tilemap.SetTile(position, null);

Sorry about this issue! This sounds like a bug. We will investigate this!

If you could file a bug with the Unity Bug Reporter that would help, thanks!

Thank you for answer.

After posting a question and searching for a few more hours, I found the problem and solution.

I think the problem occurred when I adjusted the tilemap outside the camera and then moved the tilemap back into the camera.

Change DetectChunkCullingBounds to Manual, Increasing the range of ChunkCullingBounds solved the problem.

This may be due to my lack of understanding, but the problem may be that the renderer is not automatically refreshed when the tile map is re-rendered on the camera even though DetectChunkCullingBounds is set to Auto.