Download

AI Perception component does not detect actor destruction

So I’m using an AI to shoot at a target, destroy the target, then select a new target. The logic itself works fine as i’ve also got a movement system for the AI that when it moves it runs through and selects a new target just fine.

My issue is that I want it to select a new target when I DestroyActor the target. Unfortunatley when static the list of perceived actors updates but it does not trigger the OnPerceptionUpdated. Am I missing something? Is that meant to work this way?

That should work.
As a workaround, I would put an “isDead” boolean on the AI, and check if the current target not isDead on the BT(Behavior Tree). If it is, then it will break out and roam or something until it finds a new target.

Seems like a hack, but computers are electrified rocks we make think, so…