How do I get a reference of an actor/s based on what my player can see?

Hi! I’m making a personal project based on Dishonored 2 and I’m currently trying to implement the detection meter. One of the issues I have is trying to get a reference of actors based on what my player can see.

If my player can see the enemy and the enemy can see them, I can position my meter on the enemy’s head. If the player cannot see the enemy but the enemy can see them, then my meter appears on the side of the screen. I think I have the offscreen indicator working, as it only moves on the edge of the screen but I need to know if my player can see the enemy for the mechanic to work properly.

I tried the line of sight node but that’s not exactly the right functionality I had in mind. I also thought about using a trace but wasn’t sure how to go about that.

This is one of those instances where C++ is better.

In Blueprint you can list all actors or other class that are in “visible” by using “Convert World Location to Screen Location”:

I think I’ve tried something similar with the same convert node. It still detects actors outside of FOV but (I think) in the frustum of the camera. Any “fix” for that?

Try using Rama’s extra blueprint nodes. It has the “Get Array of Currently Rendered Actors” node.

Hmm…Could you give an example of how to use that node? Would I still use the convert node?

Just use it directly:

And now you just have to filter what you want.