Search Unity

Question How to stop the rendering of a particular ruletile

Discussion in '2D' started by CHAOSdonut, May 9, 2023.

  1. CHAOSdonut

    CHAOSdonut

    Joined:
    Feb 20, 2023
    Posts:
    1
    Hi all,

    Ive been using ruleTiles to draw a path over a grid. At the end of a path it draws an arrow, but i only want to draw an arrow at the last tile of the path and not on the first one.
    Disabling the visual component of the first tile without removing it entirely should fix my problem but i havent found a way to do that.

    Basicly: using C# how do i make a particular ruleTile invisable without removing it entirely.
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    You could change the color of that particular Tile on the Tilemap through the following:
    Code (CSharp):
    1.  
    2. tilemap.RemoveTileFlags(Vector3Int.zero, TileFlags.LockColor);
    3. tilemap.SetColor(Vector3Int.zero, Color.clear);
    4.  
    This would produce the following graphically:
    upload_2023-5-12_15-20-35.png
     
    CHAOSdonut likes this.