Hey Everyone I was able to get this to work
GC_Dash.h
#include "CoreMinimal.h"
#include "GameplayCueNotify_Static.h"
#include "NiagaraSystem.h"
#include "NiagaraFunctionLibrary.h"
#include "GC_Dash.generated.h"
/**
*
*/
UCLASS()
class FPSPROJECT_API UGC_Dash : public UGameplayCueNotify_Static
{
GENERATED_BODY()
UGC_Dash();
virtual void HandleGameplayCue(AActor* MyTarget, EGameplayCueEvent::Type EventType, const FGameplayCueParameters& Parameters) override;
};
GC_Dash.cpp
#include "MainContent/GameplayAbilitySystem/Cues/GC_Dash.h"
#include "MainContent/GameplayAbilitySystem/Characters/HeroCharacter.h"
UGC_Dash::UGC_Dash()
{
GameplayCueTag = FGameplayTag::RequestGameplayTag(FName("GameplayCue.Dash.Active"));
IsOverride = true;
}
void UGC_Dash::HandleGameplayCue(AActor* MyTarget, EGameplayCueEvent::Type EventType, const FGameplayCueParameters& Parameters)
{
UE_LOG(LogTemp, Warning, TEXT("Dash GameplayCue HandleGameplayCue executed"));
Super::HandleGameplayCue(MyTarget, EventType, Parameters);
AHeroCharacter* CharacterRef = Cast<AHeroCharacter>(MyTarget);
FString NS_DashPath = "/Game/MainContent/GameplayAbilitySystem/NiagaraEffects/NS_Dash.NS_Dash";
UNiagaraSystem* DashEffect = Cast<UNiagaraSystem>(StaticLoadObject(UNiagaraSystem::StaticClass(), nullptr, *NS_DashPath));
switch (EventType)
{
case EGameplayCueEvent::OnActive:
UNiagaraFunctionLibrary::SpawnSystemAttached(
DashEffect,
CharacterRef->CharacterCameraComponent,
FName("None"),
FVector(150.0f, 0.0f, 0.0f),
FRotator(0.0f, 0.0f, 0.0f),
FVector(1.0f, 1.0f, 1.0f),
EAttachLocation::KeepRelativeOffset,
true,
ENCPoolMethod::None,
true
);
UE_LOG(LogTemp, Warning, TEXT("Dash GameplayCue OnActive executed"));
break;
case EGameplayCueEvent::WhileActive:
break;
case EGameplayCueEvent::Executed:
break;
case EGameplayCueEvent::Removed:
break;
}
}
GA_Dash.cpp
void UGA_Dash::ActivateAbility(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo, const FGameplayEventData* TriggerEventData)
{
if (!CommitAbility(Handle, ActorInfo, ActivationInfo))
{
EndAbility(Handle, ActorInfo, ActivationInfo, true, false);
return;
}
AActor* AvatarActor = ActorInfo->AvatarActor.Get();
if (!AvatarActor)
{
EndAbility(Handle, ActorInfo, ActivationInfo, true, false);
return;
}
float DashStrength = 2000.f;
float DashDuration = 0.3f;
bool bIsAdditive = false;
UCurveFloat* StrengthOverTime;
UAbilityTask_ApplyRootMotionConstantForce* DashTask =
UAbilityTask_ApplyRootMotionConstantForce::ApplyRootMotionConstantForce(
this,
NAME_None,
GetDashDirection(AvatarActor),
DashStrength,
DashDuration,
bIsAdditive,
StrengthOverTime = nullptr,
ERootMotionFinishVelocityMode::ClampVelocity,
FVector::ZeroVector,
GetMaxSpeed(AvatarActor),
false
);
if (DashTask)
{
FGameplayEffectContextHandle Context;
K2_AddGameplayCue(FGameplayTag::RequestGameplayTag("GameplayCue.Dash.Active"), Context, true);
DashTask->OnFinish.AddDynamic(this, &UGA_Dash::OnDashFinished);
DashTask->ReadyForActivation();
}
else
{
EndAbility(Handle, ActorInfo, ActivationInfo, true, false);
}
}
so first of all I implemented the gameplay ability called GA_Dash which makes the character dash, and then I started working on gameplay cue notify static I wasn’t able to get it to work even though I had everything setup correctly but then after looking here I discovered the gameplay cue editor I opened it up and saw that my tag was not assigned to a blueprint I created a blueprint child from my c++ class and looked again and saw that the editor picked up the child blueprint after creating the blueprint I just called the parent handle on it and everything worked
so basically you just need to create a child blueprint of you class and make sure that the editor picked up on it and then call the parent handler,
so I hope this is helpful to anyone looking for answers 