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.
0 |
Component | UE - Gameplay - Gameplay Ability System |
---|---|
Affects Versions | 5.3 |
Target Fix | 5.4 |
Fix Commit | 29311191 |
---|---|
Main Commit | 29311229 |
Created | Oct 30, 2023 |
---|---|
Resolved | Nov 1, 2023 |
Updated | Dec 1, 2023 |