Better way for AI Death?

Hi all,

I have a problem that when my AI pawn body is killed, the AI controller and Behavior Tree is still active, doing calculations as if it’s alive.
I want a good method of killing the bt and AI controller so that I ragdoll my AI pawns without having to destroy them.

Right now, I have a boolean in the character pawn that sets to true on death, then I have the AI controller cast to the AI body to get that bool, then set it in the BT.

Is there a better easier way?

Thank you

Have you tired using UnPossess?

I have tried using that, but it’s difficult to make it dynamic so I don’t have to implicitly cast to the AI controller.
I might have to make several controllers, and I don’t want to cast to each one per baddie.