Is there a way to check if the player can see an object?

In other words, is it possible to have a bool value that tells me “yes” when a targeted object is seen, and “no” when it is not?

I’m kinda jerry-rigging it right now to see if a targeted object is within a certain angle from me, however this method does not take into account that other objects may be in front of it. For example, my angle value to check is 60, so if the object is within 60 degrees from the center of my view port then my bool is “yes”, regardless of the fact that the object may be behind a wall.

I realize there isn’t really a “Is within view” node, but how might I accomplish checking this (if at all) in blueprints?

Check out: https://answers.unrealengine.com/questions/15923/simple-raycast-from-camera.html

Scroll down and you can see a blueprint node setup for doing a raycast from the camera position.

yes, using a dot product.

I have the code in the target object for not overwhelm the player BP, you can put a trigger when the player is close. Soo you dont need check each frame. The 0.9 is the agular value from 0 to 1.

Awesome, thanks you two! I ended up going with a trace. Works like a charm :slight_smile: