Hey just wondering if it is possible to set the sensetivety in witch a array replicates?
I noticed that if i add or remove i element to a TArray it gets replicated.
But if a member in the element structure is changed it will not replicate.
So for now i made this structure to make sure its always replicated when changed.
Now this is not a huge issue and preferly i don`t replicate alot of arrays.
But when you do, how do you prefer to do that?
This is only relevant when its a Array of structures of course but stile, love to hear your input on this.
WCode.
I noticed that if i add or remove i element to a TArray it gets replicated.
But if a member in the element structure is changed it will not replicate.
So for now i made this structure to make sure its always replicated when changed.
Code:
/** * Contains inventory array and integer "condition". */ USTRUCT(Blueprintable) struct FInventoryContainerStruct { GENERATED_USTRUCT_BODY() public: // Array of items in the inventory container. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "FInventoryContainerStruct") TArray<FItemInventoryStruct> InventoryArray; // Changed everytime array is edited, to make sure array get replicated to client. UPROPERTY() int32 Condition; /** * Update the Inventory Container to guarantee replication to owner. * @param: Pass in a posetive or negative integer. */ void UpdateArrayCondition(int32 ToAdd) { Condition += ToAdd; } };
But when you do, how do you prefer to do that?
This is only relevant when its a Array of structures of course but stile, love to hear your input on this.
WCode.
Comment