Replicate only Parts of a UStruct?

Is it possible to force replication OFF for certain properties in a USTRUCT? Basically I have a ‘Hardpoint’ Structure that contains details about weapon points on a vehicle. Most of these properties are static and never change, the only one that does is ‘CurrentWeapon’, but each component of the STRUCT has to be a UPROPERTY to enable me to add and edit them in the editor.

I know that by default all UPROPERTY’s in a USTRUCT are replicated if the USTRUCT itself is replicated, but is it possible to change that? If not, I’ll have to make my USTRUCT a class instead :confused:

I believe there is a “NoRep” uproperty specifier. I do not remember the exact wording, and I cannot look it up right now, but if you search in the engine source for an enum where all the uproperty specifiers are declared, like BlueprintReadWrite, BlueprintReadOnly, etc, you can find it there. If you have visual assist, you can find it quickly by typing in BlueprintReadWrite in the symbol search.

1 Like

Yeah you’re right, I found it a few days ago browsing docs for something else!

Do a search in the engine for NetSerialize or NetSerialise. Adding this to your struct will allow your to specific which individual elements of a struct are networked and also how they are networked (compression of data elements like Vectors).