Subobjects replication OwnerOnly condition problem

How can I replicate subobjects as OwnerOnly? It works like components, they are always being replicated if the owner actor is relevant.

Does this scenario work?

Player(Pawn) - Owner is PlayerController
SubObjectOwner(Actor) - Owner is Player and has OwnerOnly condition.
SubObject(Object) - Owner and Holder is SubObjectOwner and variable condition is OwnerOnly.

You will have to skip subobject replication for non-owning clients inside ::ReplicateSubobjects(). For example you can check RepFlags's bNetOwner if true, and if so replicate. You can also utilize bNetSimulated to skip replication. That’s off the top of my head, so make sure you test it heavily, so you aren’t missing edge cases.

1 Like

I’ll try it.