how to activate ability with custom parameters?

When I hit a target, I can add some gameplayeeffects to the target to do some damage and vfx, but I want to use ability to trigger the hit animation, because I want to add some tags that block other behaviors or abilities

But I can’t find a method to pass custom parameters and how to replicate the parameters when triggering the ability

since gameplayeffect is pure data and gameplay cue only happen on client
Is there any way to customize logic when attacked target or trigger the ability by passing parameters?

1 Like
 void ARPGCharacter::ActivateAbility(TSubclassOf<URPGGameplayAbility> GameplayAbility, TArray<ARPGCharacter*> Targets)
{
	const FGameplayAbilitySpec* AbilitySpec = GetAbilitySystemComponent()->FindAbilitySpecFromClass(GameplayAbility);

	URPGGameplayAbility* RPGGameplayAbility = Cast<URPGGameplayAbility>(AbilitySpec->Ability);
	RPGGameplayAbility->Targets = Targets;

	GetAbilitySystemComponent()->TryActivateAbility(AbilitySpec->Handle);
}

Hi!
Reading the requirements you put in your doubt, it seems you need more an Custom Ability Task, than just a single Ability.
With the Ability Tasks , you can include parameters and process them Async without block your main game thread:
Creating A Custom Async Ability Task | Epic Developer Community (epicgames.com).
Regards.