What is a proper BP to set line of sight for my AI?

I have been trying to set line of sight for my AI. Here is what I have for a BTTask_Blueprint. I want this to check if the player is line of sight of the AI. I am really confused to what put in the array.

Here is my condition check if the AI is in line of sight.

Setting the Blackboard variable should be done in a service, not on the task. Then add the service to a composite node that is higher than the one where the conditional is done.

The array seems fine, you just have a pawn, that’s fine.

I have my service set up on the higher composite, my bool is always true.

I can’t check right now, it may be that the return value is just whether or not it processed, and the actual hit info is what you need to look at. I’m not sure.

I realize this post is a few months old, but it’s not marked as solved and maybe this will help someone else. Line of Sight is a bit tricky. You don’t want you’re starting actor to be included, nor do you want the ending actor to be included, otherwise the line trace may show it hit something even if the path between the two is clear. See my setup in my answer to this post. Maybe that will help.