OnDestroy.Add with Static function

I have a static class that manages things in my game. Actors add themselves to it. I want clean up to be automatic such that when an actor adds itself it doesn’t then need to remove itself when it’s destroyed.

in my addActorFucntion I want to bind one of the static class function to the added actor’s OnDestroy.

Is this possible?

Hello! Surely this can be done through code like this (of course with corresponding signature)

		FLatentActionManager::OnLatentActionsChanged().AddStatic(&UUserWidget::OnLatentActionsChanged);

I tried something like this.

Actor->OnDestroyed.AddStatic(&UStaticClass::OnDestroy);

but I get this error.

error C2039: 'AddStatic': is not a member of 'FActorDestroyedSignature'