- Home /
Fog of War, clip through walls
Hi there, so I have made a basic fog of war system. I'm using a gird which Instantiates fog on every node and if a player hits the fog then it simply deactivates. However, now that I have done this I'm having an issue that I.m not sure on how to get around. I do not want the fog to clip through walls or anything like that and I'm unsure of how to do that? Any guidance would be amazing! Thank you!
In the picture below the blue square is the player and the black line is the wall. As you can see the player is behind the wall but the fog still goes away(this is because I'm just using void on trigger enter) but don't know of a workaround... any help would be great!
thanks again!
Answer by airbagnr1 · Mar 02, 2018 at 12:40 PM
Hi there, I actually solved this one by my self but in case for the future here is how I did this: I simply used raycasting instead of OnTriggerEnter, if a ray hit the wall which was identified by layer masking then the fog would not disappear!
Your answer
Follow this Question
Related Questions
Keeping track of which areas remain unexplored 1 Answer
How to make a Fog of War on TILE-based map? 2 Answers
2D Board game grid placement 0 Answers
Asset that can achieve a sonic game 4 Answers