I have a tilemap layer called secrets that lays on top of my layer with collision enabled. I want it so that when the player collides with the “Secret” layer, the renderer for that layer turns off, revealing a small secret area underneath. What is the syntax for enabling the tilemap layer? I tried attaching a script with this method to the layer, but it did not work. And yes, I put a tilemap collider on the “secret” layer set to trigger
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag(“Player”))
{
enabled = false;
}
}