I’ve been working with the Pawn Sensing configuration for AI in a game I’m working on, and have run into a bit of a snag. I’ve configured the AI to chase my character when he sees him, and have been able to modify the AI’s “Max Walk Speed” based upon the distance from the Player. What I would like to do is add an additional set of code so that if the Player’s camera/POV is looking at the advancing AI, the AI will act differently.
Right now, it is triggering and I’m getting the text pop-up saying “SIGHT” whenever the AI sees my character, however, I also see the message when I turn my back to it and I can’t see it.
I believe that if there is a camera configuration I could replace the “Get Player Controller” node with, it would work, but for the life of me, I cannot currently find one. Is there something you can think of that would accomplish what I’m looking to do?
I’ve never used “Line of Sight to” myself but after a little research I see it doesn’t actually check to see if your CAMERA can see the object, it just checks if there’s a path from one object to another. So you’ll get “SIGHT” only if there’s nothing between you and the object.
That does sound promising, thanks! I’ll give it a try, and report back!
Thanks, sir. Again you’ve gone above and beyond!
(I just spent hours recreating the AI code that I found in the documentation, only to find the “Pawn Sensing” code was about three nodes on a tree to get what I wanted. Dang it. Ah well, live and learn!)
When I engaged it, it showed “OUT OF SIGHT” in status whenever the AI was offscreen, and “IN SIGHT” when I could visibly see the AI on screen! It worked PERFECTLY, sir, thanks again!