[Bug Report] TArray not replicated when element Removed

I have a TArray called MyArray that is not being replicated when an element is removed. Honestly not sure why this isn’t working as the PlayerArray on GameState is clearly replicating correctly as far as I can tell (and players get removed). I’ll investigate how that is done, but I still consider this a bug because the TArray then fails to be matched by clients.

// Declaration
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, ReplicatedUsing = OnRep_MyArray, Category =    		UBPlayerState, meta = (AllowPrivateAccess = "true"))
TArray<AUBPlayerState*> MyArray;

// GetLifeTimeReplicatedProps
DOREPLIFETIME_CONDITION(AUBPlayerState, MyArray, COND_OwnerOnly);

// Replicated
MyArray.AddUnique(SomePlayerState);

// Not replicated
MyArray.Remove(SomePlayerState);

Hey -

According to the API documentation for TArrays (TArray | Unreal Engine Documentation) it appears that Remove() will remove all instances of the given parameter in the array. If you are trying to remove only a single element from the array you may want to try RemoveSingle().

Cheers

But my issue isn’t trying to remove a single object… My issue is that the removal of the object isn’t replicated. Are you saying RemoveSingle will be replicated?

Hey -

Sorry for the misunderstanding. I’m still looking into the state of replication with TArrays and will let you know if this is indeed a bug when I have more information.

Hey -

Would it be possible for you to send us a sample project where this issue is occuring? If you’re able to upload the project to dropbox you can then send me a private message on the forms with the link to the dropbox.

Thanks

Hey -

We’ve not heard from you in a few days, so we are marking this post as resolved for tracking purposes. If you are still having problems with your array replicating properly, please feel free to reopen this post by posting a comment with the additional information requested and we will investigate this issue further.

Cheers