I’ve just implemented Pawn Sensing on my AI to get bots to follow my player once the OnSeePawn event is fired. However, there does not seem to be the equivalent event for when line of sight is lost. I’m wonder what the best method is of implementing a “lost line of sight” event. Pawn sensing only has the “OnSeePawn” and “OnHearNoise” events.
Hi ,
If it looses site of you, it will stop.
I’m pretty sure he’s looking for an event trigger for when the AI loses sight so he can do something. I am currently looking to do the same thing. I need text to appear on my hud only when the ai has lost sight
For anyone like me that still is looking for this solution. I did not solve it but I have a work around.
The blueprint I am using is a turret enemy. Once it sees you it follows you and fires. But I also wanted it to go back to it’s original rotation. Once it stops seeing you it resets.
There is a cone shaped area of which the PawnSensing is using as it’s trigger area. What I did was I added a cone mesh to the blueprint in the same shape as that area of sight. I sized it the best I could. It is slightly off but whatever. I set it’s collision to overlap all and set the material to invisible. Which is just a material with the opacity set to zero. Now I have something in the blueprint with a begin and end overlap events.
The work around works for now but I would like to know if there is a proper way to do this. I really don’t want to have to keep throwing in extra shapes just to use as trigger boxes.
You can do this with your own event. You just have to check the currently perceived actors and see if your enemy resides in it. OnTargetPerceptionUpdated will get called whenever the list of perceived actors change.
EDIT: Branch should be on False, not on True
been a while since i used this but i also believe you can break the Stimulus and check bSuccessfullySensed?
instead of the contains node. worth a quick test at least