I'm working on Unreal Engine 5.3.2, Gameplay Abilities plugin version 1.0.
When creating a custom TargetData class in order to pass information through the event's handle, you can't use NetSerialize on FName variables. The compiler brings up an error saying that NetSerialize is not a member of FName.
What I have been able to do for my specific implementation is pass that data that would have been an FName as a string, and use SerializeAsANSICharArray() in order to serialize the data in that string and pass it in the handle.
// This is required for all child structs of FGameplayAbilityTargetData
bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
{
MyFName.SerializeAsANSICharArray(Ar);
bOutSuccess = true;
return true;
}
I'm working on Unreal Engine 5.3.2, Gameplay Abilities plugin version 1.0.
When creating a custom TargetData class in order to pass information through the event's handle, you can't use NetSerialize on FName variables. The compiler brings up an error saying that NetSerialize is not a member of FName.
What I have been able to do for my specific implementation is pass that data that would have been an FName as a string, and use SerializeAsANSICharArray() in order to serialize the data in that string and pass it in the handle.
// This is required for all child structs of FGameplayAbilityTargetData bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) { MyFName.SerializeAsANSICharArray(Ar); bOutSuccess = true; return true; }