How do I make a character despawn?

Hi, I’m fairly new to UE so help would be appreciated. I have a AI character who will chase me around as well as walk idle with a wonder task. I have it set up so a behaviour tree will run allowing this to happen. Currently when the characters health reaches zero it will ragdoll, but i want to make it so that after a few seconds it will despawn and I do not know how to do this as using the destroy function gives me a number of errors.

Thanks
-Dan

Set the lifespan of this actor. When it expires the object will be destroyed. If requested lifespan is 0, the timer is cleared and the actor will not be destroyed.

Thank you