为什么 UnrealHeaderTool 在构建 RPC 时失败

Why is UnrealHeaderTool failing when building RPCs

在我的 pawn 头文件中,我试图声明一个 RPC。以下编译正确:

UFUNCTION( ) void ClientSetPosition(FTransform position);

然而这并不能编译:

UFUNCTION( Client ) void ClientSetPosition(FTransform position);

我收到以下错误:

UnrealHeaderTool failed for target 'MultiEditor' (platform: Win64, module info: C:\Users\myself\Documents\Unreal Projects\Multi\Intermediate\Build\Win64\MultiEditor\Development\MultiEditor.uhtmanifest, exit code: OtherCompilationError (5)).

The command ""C:\Program Files\Epic Games\UE_4.21\Engine\Build\BatchFiles\Build.bat" MultiEditor Win64 Development "C:\Users\myself\Documents\Unreal Projects\Multi\Multi.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.

有没有想过为什么会这样?

以下解决了问题: UFUNCTION(客户,可靠)

他们必须更新 unreal 才能需要这个变量。