Download

Getting list of granted abilities from GAS

I would like to get a list of the granted Abilities on a Character from tags if possible.

I tried to edit the AbilitySystemComponent classe to add a function which would do that:

in AbilitySystemComponent .h

UFUNCTION(BlueprintCallable, Category = "Abilities")
	TArray<FGameplayAbilitySpec>& GetActivatableGameplayAbilitiesByAllMatchingTags(const FGameplayTagContainer& GameplayTagContainer);

and in AbilitySystemComponent .cpp

TArray<FGameplayAbilitySpec>& UAbilitySystemComponent::GetActivatableGameplayAbilitiesByAllMatchingTags(const FGameplayTagContainer& GameplayTagContainer)
{
	TArray<FGameplayAbilitySpec*> AbilitiesSpecs;
	GetActivatableGameplayAbilitySpecsByAllMatchingTags(GameplayTagContainer, AbilitiesSpecs);



	TArray<FGameplayAbilitySpec>& Abilities;

	for (auto GameplayAbilitySpec : AbilitiesSpecs)
	{
		Abilities.Add(GameplayAbilitySpec)
	}


	return Abilities
}

There is no error when I compile but I don’t have the function available in blueprint :frowning:

I don’t know much about C++ so I might do something really stupid, I tried few different things without success so far…

I’m still having issues, I tried to simplify to at least just have the function to show up in blueprint but I have nothing.

UFUNCTION(BlueprintCallable, Category = "Abilities")
TArray<FGameplayAbilitySpec>& GetActivatableGameplayAbilitiesByAllMatchingTags();




TArray<FGameplayAbilitySpec>& UAbilitySystemComponent::GetActivatableGameplayAbilitiesByAllMatchingTags()
{

	return ActivatableAbilities.Items;

}

Anything wrong with this ?