UField::GetMetaDataText not a member of UFloatProperty in Packaged Build?

Hi guys,

I am using the UField::GetMetaDataText in my project on UFloatProperties, UIntProperties and some more. When I compile and play in editor everything works fine. When I try to package my game for Windows (I tried 64 and 32 bit) I get these errors for every call of GetMetaDataText, GetFLOATMetaData, GetINTMetaData, GetBoolMetaData and GetMetaData :

UATHelper: Packaging (Windows (32-bit)): UnrealBuildTool: C:\Workspaces\Unreal Engine 4\TheSpaceGame\Source\TheSpaceGame\ModuleControlPanel.cpp(60): error C2039: "GetMetaDataText": Ist kein Element von "UFloatProperty"
UATHelper: Packaging (Windows (32-bit)): UnrealBuildTool: c:\program files (x86)\epic games\ue_4.16\engine\source\runtime\coreuobject\public\UObject/UnrealType.h(1648): note: Siehe Deklaration von "UFloatProperty"

Translation: It just says that GetMetaDataText is not a member of UFloatProperty, and refers to the header of UFloatProperty.

GetMetaDataText is a member of UField which is a base-class of UFloatProperty, so there should not be a problem there. This only happens in packaging, a normal compile works fine. Are these methods somehow not available in a packaged game? I rely on them for various functionality in my game and it would be a substantial amount of work to replace them. Or is there something about the localized text (since thats what GetMetaDataText returns) that I need to have in a packaged game and not in the editor?

Please Help!

kind regards, Simon

1 Like

All those functions are wrapped within WITH_EDITOR so aren’t available in non-editor builds. Meta-data itself also isn’t available in non-editor builds (and never has been).

Oh that’s baaaaaaad. For me. Thanks.

1 Like

Ok now that I know that: Is there more of the reflection system that’s not available in non-editor builds? “FindPropertyByName” for example? (That would be really really bad for me).

1 Like

I’m not aware of anything else reflection related that’s removed in a cooked build.

FindPropertyByName definitely exists, but if you’re ever unsure you can check the header file for the function and see if it’s wrapped in WITH_EDITOR or WITH_EDITORONLY_DATA before using it :slight_smile:

is there any method to understand where and when this behavior occurs? I have been using ALandscape, and have encountered the same issue where a simple function like ALandscape->Import compiles and runs in the local editor, but fails when packaging for windows. There is no reference to this on the documentation: ALandscape | Unreal Engine Documentation. There is no way to identify this behavior until packaging unless one has a complete intuition of every line of every class file in the Editor source code. How do developers identify the logic wrapped exclusively for in editor?