Just trying to get a boilerplate Gameplay Ability to trigger the Activate event. Can anyone see if I’m doing anything wrong?
void AETHD_Hero::BeginPlay()
{
Super::BeginPlay();
}
AETHD_Hero::AETHD_Hero(const FObjectInitializer& OI) : Super(OI.SetDefaultSubobjectClass<UMICharacterMovementComponent>(ACharacter::CharacterMovementComponentName))
{
AbilSysComp = AETHD_Hero::CreateDefaultSubobject<UETHD_AbilitySystemComponent>("HeroAbilitySystemComponent");
DefAttSet = CreateDefaultSubobject<UETHD_AttributeSet>("DefaultHeroAttributes");
}
UAbilitySystemComponent* AETHD_Hero::GetAbilitySystemComponent() const
{
return AbilSysComp;
}
//////
UETHD_GameplayAbility::UETHD_GameplayAbility(const FObjectInitializer& OI) : Super(OI)
{
InstancingPolicy = EGameplayAbilityInstancingPolicy::InstancedPerActor;
SetFlags(EObjectFlags::RF_ClassDefaultObject);
if (CurrentActorInfo == nullptr)
{
AActor* OwnerActor = Cast<AActor>(GetOuter());
UAbilitySystemComponent* AbilitySystemComponent = nullptr;
if (OwnerActor != nullptr)
{
const IAbilitySystemInterface* ASI = Cast<IAbilitySystemInterface>(OwnerActor);
if (ASI)
{
AbilitySystemComponent = ASI->GetAbilitySystemComponent();
}
else
{
AbilitySystemComponent = OwnerActor->FindComponentByClass<UAbilitySystemComponent>();
}
}
if (AbilitySystemComponent != nullptr)
{
CurrentActorInfo = AbilitySystemComponent->AbilityActorInfo.Get();
}
}
}
//////
UETHD_AbilitySystemComponent::UETHD_AbilitySystemComponent(const FObjectInitializer& OI) : Super(OI)
{
}
https://cdn.discordapp.com/attachments/307697678278590465/1008837168401227846/unknown.png