Download

Replicating arrays

When replicating a static array like this:



UPROPERTY(ReplicatedUsing=OnRep_SomeArray)
int32[8] SomeArray;


and you initialize this array with some set of values



for(int i = 0; i < 8; i++)
{
    SomeArray* = 123;
}


Would this cause the OnRep_SomeArray() function to be called 8 times? Is there a way to wait for all replication to complete and then execute the OnRep function or put a check inside the OnRep function?

No, as long as every element of the array is modified on the same frame there will be only one OnRep call. If the modifications occur over multiple frames, there may be one or more OnRep calls, because the property changes may end up in different network packets.

Hope this helps!

Awesome, thanks!