Download

Ai Controller

Hi I have got quite far with my ai, it shoots, reloads, guards points, hears noises, chases, can detect line of sight and move into sight when player is hiding, look for player when loses sight but theres one thing that’s annoying me when I kill the enemy there is no way to disable or destroy the pawn sensing component.

The only way I found that works is to set the see and hear bools to false. Except when I do this using get all actors of class It does it for every spawned actor that uses the pawn sensing component. How would I go about doing it for each individual spawned enemy? So the ones that are still alive have senses.

What do you do when you kill the enemy? The pawn sensing component is just a component of a pawn. Normally when you kill another pawn you’d disable it or even destroy the actor (depends a bit on the game), then the pawn sensing component should be disabled with its parent pawn.

There’s also the AI perception system which allows a bit more tweaking.

I can destroy the bp’s after a delay after death but the aicomponent just stays alive and still sees my character.

I get all actors of class and then do a for each loop and destroy the actor. cant get rid of the ai component or turn it off for just the killed ones only and if I set see pawns and hear noises to false it turns it off for every spawned char and not just the killed ones

The garbage collection usually takes up to 60 seconds.So what do you actually do on death -you disable the pawn? How do you debug it?