Hi all,
I'm trying to implement an effect that shows when a player would be in an NPCs field of vision. It's effectively a semi-transparent triangle that sits in front of the NPC and moves around with them.
I can use raycasts and areas to actually detect whether the player character can be seen by the NPC, but I'm struggling with showing this on the screen. The hint area keeps on clipping through other objects and displaying in areas that the player character would not be considered 'visible' at.
Here's an example of the clipping problem that I'm having:

I want to make it so that the yellow triangle doesn't go through the wall on the left. Any suggestions on how I can implement that?
The yellow triangle is made up of a MeshInstance
, Area
, and a CollisionShape
. I don't really need to adjust the geometry of the area/collision shape since my ray will be able to tell when the player is not visible to the NPC.