SequencePlayer is replicated explicitly in ALevelSequenceActor::BeginPlay(), via AddReplicatedSubObject(GetSequencePlayer());
Actor Components have a lot of hidden code for managing their replication, giving the appearance of automatic sub object replication, when really it’s just code looping the components and for any GetIsReplicated(), setting up replication. See calls to AActor::AddComponentForReplication. Replication isn’t really just a default feature of sub objects in all circumstances.
The sequence player isn’t a component, so it can’t rely on that hidden automatic replication.
The reason I suspect transient is just based on the intuition that because the field doesn’t save/load, the UPROPERTY is losing its value at some point in the process, and needs to be replicated to ensure the client points to a valid object. I can’t pinpoint where that occurs, so it may be more complicated than that. Or something else entirely. It looks like ALevelSequenceActor::PostLoad() assumes the presence of a SequencePlayer, so that kinda undermines my line of thinking.
Whatever Epics rationale is for the setup of this property, and whether or not it has anything at all to do with the transient flag, it sounds like what you are trying to do is fundamentally unsafe.
Resetting a replicated object reference to it’s default value sets it to null, as expected. What’s unexpected is that in this case we’ve marked a reference to a default sub object as being replicated.
You can’t assume that any replicated UObject property is safe to null out. We replicate UObject properties that point to cosmetic assets for the character. It would break quite a bit to have something null those out just because they are replicated. Can you explain what the purpose behind this(seemingly) indiscriminate nulling of replicated properties? You didn’t really explain the scope of this operation, or what deciding logic might precede this operation, but if you’re talking about server travel I assume you’re just doing this on select actors involved in the travel? In what circumstance does a level sequence need to travel? Even on a narrow set of actors, like characters, it sounds very unsafe.
For example, our inventory component is object based, which means we have UItemInstance. The inventory has an array of references to them, It replicates them as subobject, like sequencer and components, and it has replicated TObjectPtr property fields to point to specific ones that are equipped in various slots. A characters inventory would need to travel, but no system should be nulling anything out in there.
Just doing a regex of UPROPERTY with replicated and TObjectPtr, there are quite a few in the engine alone, and virtually all of them would probably crash if some code came in and just nulled out their object pointers underneath them. We have many more at the project level.
[Image Removed]
[Attachment Removed]