To determine when a particular ability ended, you can use the OnAbilityEnded
delegate on the AbilitySystemComponent.
ASC->OnAbilityEnded.AddUObject(this, &ThisClass::AbilityEnded);
This function is passed a struct containing information about the ability which ended.
If you want to know that a specific ability ended, the easiest way to do it is to compare the spec handle:
//Store the spec handle you get from GiveAbility
SpecHandle = ASC->GiveAbility(...);
//Compare the spec handle in the delegate handler
void AMyActor::AbilityEnded(const FAbilityEndedData& AbilityEndedData)
{
if(AbilityEndedData.AbilitySpecHandle == SpecHandle)
{
//Do something
}
}
The ended data contains other info as well, such as the ability instance that ended, which could also be used to check it.