Can I use UProperty properties in shipping build?

Hi.

Is it possible to use UPROPERTY to store my custom information ?

Basically I would like to add some information into UPROPERTY macro.

Like this:

	UPROPERTY(Transient, meta = (CustomMeta))
	AMyActor* MyActor;

This is working fine in editor because UProperties has function

HasMetaData(const TCHAR* Key);

But sadly thats editor only logic, so it is impossible to use it in a shipping build without messing with engine.
Is there any other way to mark so I can say exacly what properties are marked by me ?

Thank you,

Jakub

From the UE4 documentation:

Metadata can be accessed by C++ code when running Editor builds, but it will not be present in shipped products. Game logic should not use metadata.

(found here: Metadata Specifiers in Unreal Engine | Unreal Engine 5.3 Documentation)

So for meta data the answer is no, I’m afriad not. With engine modifications you could either remove this restriction (not recommended) or you could add your own, non-meta data specifiers.

Other than that, you could create your own classes / structures / types that might give you the functionality your after, but without knowing what you’re trying to achieve I don’t know how well that would work.

You are absolutely right with metadata beeing editor only.

Imagine I have a several actor classes and each of them has components. I would like to automate creation of these components in specific time during runtime.

for example:

UPROPERTY(Transient, CUSTOMFLAG_FIRST_PHASE)
UActorComponent* FirstPhaseComponent;

UPROPERTY(Transient, CUSTOMFLAG_SECOND_PHASE)
UActorComponent* SecondPhaseComponent;

UPROPERTY(Transient, CUSTOMFLAG_THIRD_PHASE)
UActorComponent* ThirdPhaseComponent;

I would like to just iterate over all UProperties (which I can) and decide whether Its correct component to initialize.

But this is just one example. Aim of this is just extend UProperty flags/meta with my custom information. For now its look like I will need to add custom flag if I want to do it this way.

Sure there is bunch of other ways to deal with this example but thats not what I’m wondering about.

Just to revisit and close this issue - best solution for me was to create custom UProperty specifier by engine modification. Meta is intended only editor and its fine.