UAbilitySystemComponent::DestroyActiveState() is called when the component is unregistered (OnUnregister) and when its destroyed (OnComponentDestroyed). It performs state cleanup such as canceling abilities and cleaning up ability instances.
The function sets a bool bDestroyActiveStateInitiated to true to ensure the cleanup is only done once. This is never set to false again.
This causes problems when the owning actor goes through a lifecycle where it will exit and re-enter play. Specifically, this causes problems when:
In both these cases the AbilitySystemComponent re-enters play but when removed again, DestroyActiveState() is skipped so abilities are not canceled and cleaned up.
Expected: DestroyActiveState() should perform cleanup whenever the actor is removed from play, not only the first time.
See attached repro project:
Expected: DestroyActiveState() should not be skipped even when the ASC re-enters play.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-199290 in the post.