How to make a minimap. I prepared a scene with a player, enemies and a few walls. Add enemy tag.
Add minimap layers. Disable minimap layer from main camera calling mask. Change environment layer.
Add image in the corner of the screen. Add mask component. Add raw image as child of that image. Add image as overlay and make it fill on camera angle.
Create camera set it to orthographic and make it point straight down. Adjust camera size and modify its calling mask to only see the minimap objects. Create render texture. Edit as a target texture in Secondary Camera. Add sprite renderer to player object and change its layer.
Add sprite renderer to enemy's object and change the layer and tag. Change tag of player object. Add render texture as texture to previously created raw image.
Create minimap script. Make game object for player. Find every enemy in Start method.
In Update iterate through enemies and disable the sprite if the angle between player's forward and vector to enemy position is greater than half the camera angle. You can also use take cast to check if enemies are behind the walls. Rotate minimap overlay depending on player's rotation. Add this script as component to minimap camera object. And that's the result.
Check out my other videos and subscribe.