Why would an Actor be indestructable?

I’m making a tennis game, I have a ball based on AActor and I can’t seem to destroy it.
The ball only has a MeshComponent with physics turned on.
I’ve tried using a KillZVolume, I’ve tried setting the Initial Life Span, and I’ve sent a reference to a GameMode where I’ve tried Ball->Destroy() (AActor->Destroy()) and World->Destroy().
I’m not sure how to debug KillZVolume or Initial Life Span but they don’t do anything to this actor.
Ball->Destroy() returns false and World->Destroy() returns true but doesn’t have any other effect. I know, World->Destroy requires the garbage collector to remove things, but I can’t find documentation on whether I can trigger that or how.

TLDR: I have an actor I can’t destroy. The AActor->Destroy() documentation says that it will return false if the actor is indestructible, but never describes why an actor would be indestructible. Have I missed something obvious? What could cause this?

OK. I figured it out.
I wasn’t calling Super::BeginPlay().
I initially set StaticMeshActor as the parent class and switched to Actor when Destroy wasn’t working. So the default Actor functions weren’t set up for me and I had to write them myself.
I wrote my BeginPlay function to do one thing and forgot to call Super::BeginPlay(). AActor::BeginPlay() calls SetLifeSpan() and it seems like it does other things you need in order to destroy an actor (though I can’t figure out exactly which lines do this).

3 Likes

Thanks! Had the same bug and this fixed it for me!