Download

AbilityTargetDataFromHitResult kicking players out

I’m trying to pass some target data to a gameplay ability, when I pass a hit result the client gets kicked out due to a mismatch.
I have tried passing a full FHitResult aswell as a partial one with only hitLocation filled in, both kick the player out

Is there something I’m doing wrong, or is it a bug?

FGameplayEventData Payload;
				Payload.TargetData = UAbilitySystemBlueprintLibrary::AbilityTargetDataFromHitResult(NewHit); //This is causing the local player to be kicked out when the RPC runs
				Payload.Instigator = GetOwner();
				Payload.Target = GetOwner();
				FGameplayTag Tag = FGameplayTag::RequestGameplayTag("Data.TargetData");
				Payload.EventTag = Tag;

				if (GetOwner()->GetLocalRole() != ROLE_Authority)
				{
					ServerSendGameplayEvent(OwningPawn, Tag, Payload);
					//TODO Check why it's kicking out of the game
				}
				UAbilitySystemBlueprintLibrary::SendGameplayEventToActor(GetOwner(), Tag, Payload);
void UInteractionComponent::ServerSendGameplayEvent_Implementation(AActor* TargetActor, FGameplayTag Tag, FGameplayEventData EventData)
{
	UAbilitySystemBlueprintLibrary::SendGameplayEventToActor(TargetActor, Tag, EventData);
}

bool UInteractionComponent::ServerSendGameplayEvent_Validate(AActor* TargetActor, FGameplayTag Tag, FGameplayEventData EventData)
{
	return true;
}
1 Like