Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetSerialize won't work for FNames #144

Open
Juan-Ignacio-Tubio opened this issue Nov 13, 2024 · 0 comments
Open

NetSerialize won't work for FNames #144

Juan-Ignacio-Tubio opened this issue Nov 13, 2024 · 0 comments

Comments

@Juan-Ignacio-Tubio
Copy link

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant