- Home /
How could I make a fog of war on a tilemap
Hello, I'm creating a top-down classic rpg and created a menu showing the map. I'd like to hide unvisited places and reveal the visited ones but I struggle to do it. Here's a screenshot of a map I've designed (using tilemap tool) for test purposes: https://prnt.sc/tb05ur
I used this tutorial https://www.youtube.com/watch?v=MUV9Nr-cIGU and it works but it needs a "Raw Image" component. The problem is that the latter must have a square or rectangular form as you can see on this screenshot https://prnt.sc/tb2wy6
While as you've previously seen, the tilemap is not a square neither is a rectangle. I'm still looking for a way to only hide the tilemap and not more. Maybe the shader and Raw Image were not a good idea for what I'm doing, in this case I'd be happy to know your opinion and what should I do then.
I've made a drag system, it means the player can navigate on the map by dragging the map with the cursor and if I let the Raw Image as it is now... The player will see that there are still unvisited places while it's not about it. That's my main reason while I'd like to only make the fog of war effect active on the tilemap and that it doesn't go further tilemap edges.
If you need more screenshots or more details, I'll be glad to do some. Thank you very much if you can help me with this.
Your answer
Follow this Question
Related Questions
Prefab to a tile script 0 Answers
What's better to use: Collider tilemap 2D or edge collider? 0 Answers
How to duplicate several layers in a tilemap?,How to duplicate layered tilemaps? 0 Answers
tile palette offset tiles stacking not lining up 0 Answers
Change position in my scene based on a click on a 2d topdown map texture? 1 Answer