I have “AI” object (class inherited from AIController) in my “NPC” class which controls behavior of my NPCs. When an NPC dies, i want to destroy this object, but it seems indestructible! I call Destroy Actor on it, but it still ticks every frame and does all the logic no matter what forever. I know that objects on Destroy Actor are marked as pending kill and destroy later (next frame?), but this one doesn’t destroy at all. Every “AI” object of every dead NPC is still visible in World Outliner. What can cause this?
I’ve tried calling UnPosses before Destroy Actor, creating a function “DestroyAI” in “AI” class and calling Destroy Actor there, but it didn’t helped.
Oh, so that’s why… Thanks. So I’ve created “DestroyAI” function (with AIController parameter) in my GameMode blueprint and call it from my dying NPC, but it still can’t destroy it
It’s just a DestroyActor node targeted to this AIController object, so yeah… But my “AI” object is not a player controller, but AI controller, so i don’t know how to destroy it by other node than DestroyActor.
I have a little unusual AI setup, I didn’t used behavior trees, etc, because they were bugged back in 4.6… So in my project every NPC spawns its own “AI” blueprint (derived from AIController) in Begin Play which controls him - Well, maybe I should rework my AI setup somehow, if destroying these is not possible…