Disable the tilemap Renderer and tilemap collider 2D

I’m making a platformer where I want to be able to hide different tiles and remove the collider with the push of a button.
I know that you can use GetComponent<> to disable components, but I don’t know what to write inside the <>.
I’ve tried writing tilemap_renderer, tilemaprenderer, tilemapcollider2D, tile map collider 2D…etc and none of them work. I feel like it’s very simple, but can’t find it anywhere.
Any help?

@ishadeyone I’m having the same problem and found this extremely helpful article.

Delete the functions for his specific program in the example scripts and change the end of the test script to this:

if (tiles.TryGetValue(point, out flagTile))
			flagTile.TilemapMember.SetTileFlags(flagTile.LocalPlace, TileFlags.None);
			flagTile.TilemapMember.SetColor(flagTile.LocalPlace, Color.clear);
			flagTile.TilemapMember.SetColliderType(flagTile.LocalPlace, Tile.ColliderType.None);

That will set the collider to none at the tile coordinates and set the color to clear. I know it isn’t targeting the renderer specifically, but it’s like it’s being deactivated.

You may also want to read up on “Scriptable Tiles” in the Unity manual.

I still have to figure out how to “reactivate” them, but I hope you find this helpful.

I may be late but you need to add

using UnityEngine.Tilemaps;

and to disable the “TilemapRenderer”

TilemapRenderer tilemap;

void Start()
        tilemap = GetComponent<TilemapRenderer>();

void Update()
        tilemap.enabled = false;

And for the collider just do TilemapCollider