How do I turn a part of the tilemap full black to restrict the player from seeing it?

Hey everyone,

I’m making a 2D platformer and I’m dividing rooms with doors. I want to restrict what player sees on the other side of the door until the player opens the door using the trigger before it. That is, I want to turn the whole room dark, and when the door opens, an animation plays as the darkness disappears and the room is revealed. I’m not sure how exactly do you call this feature, it’s similar to a fog of war. The whole level is made up from multiple tilemaps.

To provide an example, you can take a look at any Enter the Gungeon gameplay how the player enters a new unopened room. I want to do pretty much the same.

I would just overlay a black sprite over top. Then you can enable and disable it as needed. Like in your pic above you make a black sprite the size and shape of your room and then you reference it in a script, you can call it shadow, then when you open the door you can call shadow.gameObject.SetActive(false); and when you close the door you can call shadow.gameObject.SetActive(true);