I’m making a WheeledPawn able to work with Lyra ASC.
The problem I faced is that I can’t trigger abilities. They are granted, and
void UECRAbilitySystemComponent::AbilityInputTagPressed(const FGameplayTag& InputTag)
{
if (InputTag.IsValid())
{
for (const FGameplayAbilitySpec& AbilitySpec : ActivatableAbilities.Items)
{
if (AbilitySpec.Ability && (AbilitySpec.DynamicAbilityTags.HasTagExact(InputTag)))
{
InputPressedSpecHandles.AddUnique(AbilitySpec.Handle);
InputHeldSpecHandles.AddUnique(AbilitySpec.Handle);
UE_LOG(LogTemp, Warning, TEXT("A Tag %s pressed, adding handle %s, new length %d"),
*(InputTag.ToString()), *(GetNameSafe(AbilitySpec.Ability)), InputPressedSpecHandles.Num())
}
}
}
}
lets me know that tag is added to InputPressedSpecHandles (it becomes len 1). But then in void UECRAbilitySystemComponent::ProcessAbilityInput
:
UE_LOG(LogTemp, Warning, TEXT("Processing pressed %d"), InputPressedSpecHandles.Num())
Says that InputPressedSpecHandles len is 0. I marked every line with debugger stop point where InputPressedSpecHandles.Reset() is called (constructor, end of ProcessAbilityInput and CancelAbilityInput), nothing triggers between where it’s added and the line where it prints that len is 0. It shouldn’t be Garbage Collector as InputPressedSpecHandles
is an array of structures.
However, since InputPressedSpecHandles
len is 0 in the process ability input, no abilities are activated by input I send.