Check if an Object IS VISIBLE in Camera / FOV / Field of View

How can i check if an Object / Character / Actor “IS VISIBLE” for the Player or not?
(Is in FOV 90° and nothing blocking the View)
I want to make an AI that randomly spawns around when the Player CAN’T SEE it, and do something else if he CAN SEE it.

I just found some Blueprint explenations online, like line trace but I couldnt find anything on how to use it in game…
I’m still pretty new…

Any Idea on how I can do this? ._.

A ghetto but maybe effective way is to just attach a collision box [sized to how far you can see] in front of your playable character. Then use the overlap/is in field blueprint nodes for an even to happen when the AI comes in contact with it. Then create an event when the AI is no longer in the collision box.

i tried that before and yeah it actually worked. But it was just WAY to ghetto :smiley:
Because then my AI triggered the ItemPickup by EventOverlap. So I could pick up Items that are 20m away, because of the AI standing near to it :smiley:

So sadly, I cant do that ._.
But still, thank you :slight_smile: I appreciate your reply ^-^ <3

Itll miss a little on the edges but do a cone trace from the players eyes in the direction they are looking. The returned list is actors that the player is looking at. To simplify it, I’d use a custom collision channel so that only certain types of objects are returned.