I use this function in my jump ability blueprint (like lyragame), but when I print some test string, I found the function does not work.Caused by any configures missed?
I have the same question. my solution is in below
ULyraAbilitySystemComponent::ProcessAbilityInput(float DeltaTime, bool bGamePaused) Function will handle AbilityInput in Lyra. Lyra Has Override two function AbilitySpecInputPressed and AbilitySpecInputReleased. thoes function will call InvokeReplicatedEvent which is correspond with AbilityTask_WaitInputPress And AbilityTask_WaitInputRelease.
Getting this same issue coming from 5.4 to 5.5. Had my own project where wait input release worked fine. Upgraded to 5.5 and now it won’t work at all. DL’d Lyra 5.5 and it works fine there. No idea what could be the issue. While digging I found that the Delegate InvocationList is empty on my project while other projects link back to the OnReleaseCallback. But it’s the same exact code doing all of that so no idea why it wouldn’t work now.
Same problem here.
hi, did you solve it ?
The 5.5 WaitInputRelease issue is solved in the Lyra source
Take a look at the changes in LyraAbilitySystemComponent.cpp in ULyraAbilitySystemComponent::AbilitySpecInputPressed and ULyraAbilitySystemComponent::AbilitySpecInputReleased
The prediction key needs to be obtained differently now
Unfortuantely it looks like it works in editor but still doesnt work in packaged client/server
I had the same problem with my own version of Lyra and i solved it by copying the latest version of LyraGameplayAbility.
Go to the UE5 source code on GH (or you can download the Lyra Starter Game again to another dir) and go at this directory.
Copy the code of LyraGameplayAbility.h and LyraGameplayAbility.cpp to your own project and it should work.
Try the same with the LyraAbilitySystemComponent in AbilitySytem/Abilites too.
I have been debugging a little this afternoon trying to work out why it doesnt work in client when on dedicated server
This is what the client shows when activating the ability remotely:
UAbilityTask_WaitInputRelease::Activate
UAbilityTask_WaitInputRelease::Activate StartTime: 2.047209
UAbilityTask_WaitInputRelease::Activate bTestInitialState: false
UAbilityTask_WaitInputRelease::Activate IsLocallyControlled(): true
UAbilityTask_WaitInputRelease::Activate GetAbilitySpecHandle(): 4
UAbilityTask_WaitInputRelease::Activate GetActivationPredictionKey(): [1/0]
UAbilitySystemComponent::AbilityReplicatedEventDelegate
UAbilitySystemComponent::AbilityReplicatedEventDelegate AbilityHandle: 4
UAbilitySystemComponent::AbilityReplicatedEventDelegate AbilityOriginalPredictionKey: [1/0]
UAbilityTask_WaitInputRelease::Activate IsForRemoteClient(): false
This is what the server shows when the ability first activates:
UAbilityTask_WaitInputRelease::Activate
UAbilityTask_WaitInputRelease::Activate StartTime: 24.741190
UAbilityTask_WaitInputRelease::Activate bTestInitialState: false
UAbilityTask_WaitInputRelease::Activate IsLocallyControlled(): false
UAbilityTask_WaitInputRelease::Activate GetAbilitySpecHandle(): 4
UAbilityTask_WaitInputRelease::Activate GetActivationPredictionKey(): [1/0]
UAbilitySystemComponent::AbilityReplicatedEventDelegate
UAbilitySystemComponent::AbilityReplicatedEventDelegate AbilityHandle: 4
UAbilitySystemComponent::AbilityReplicatedEventDelegate AbilityOriginalPredictionKey: [1/0]
UAbilityTask_WaitInputRelease::Activate IsForRemoteClient(): true
UAbilitySystemComponent::CallReplicatedEventDelegateIfSet
UAbilitySystemComponent::CallReplicatedEventDelegateIfSet AbilityHandle: 4
UAbilitySystemComponent::CallReplicatedEventDelegateIfSet AbilityOriginalPredictionKey: [1/0]
UAbilityTask_WaitInputRelease::WaitingOnRemotePlayerData
And this is what the client shows when releasing the key:
UAbilitySystemComponent::InvokeReplicatedEvent
UAbilitySystemComponent::InvokeReplicatedEvent AbilityHandle: 4
UAbilitySystemComponent::InvokeReplicatedEvent AbilityOriginalPredictionKey: [0/0]
UAbilitySystemComponent::InvokeReplicatedEvent ReplicatedData->PredictionKey: [0/0]
Somewhere it has lost the prediction key value so when it builds the FGameplayAbilitySpecHandleAndPredictionKey for AbilityTargetDataMap it wont be found
Any ideas?
I found that doing:
TArray<UGameplayAbility*> Instances = AbilitySpec->GetAbilityInstances();
for (auto Instance : Instances)
{
FPredictionKey InstancePredictionKey = Instance->GetCurrentActivationInfo().GetActivationPredictionKey();
}
Would show the correct prediction key
The issue can be fully resolved by changing Lyra’s code to:
void USandboxProjectAbilitySystemComponent::AbilitySpecInputReleased(FGameplayAbilitySpec& Spec)
{
Super::AbilitySpecInputReleased(Spec);
if(Spec.IsActive())
{
TArray<UGameplayAbility*> Instances = Spec.GetAbilityInstances();
const FGameplayAbilityActivationInfo& ActivationInfo = Instances.Last()->GetCurrentActivationInfoRef();
FPredictionKey OriginalPredictionKey = ActivationInfo.GetActivationPredictionKey();
InvokeReplicatedEvent(EAbilityGenericReplicatedEvent::InputReleased, Spec.Handle, OriginalPredictionKey);
}
}
Thanks, it worked
Hi guys, can you post the full fix will file names please, I can’t find the 5.5 Lyra version anywhere except from FAB which give me only the 5.2 …
Thanks