Hello
We have an actor that is replicating subobjects.
The subobjects are added at runtime server side using NewObject<> and registered using AddReplicatedSubObject.
They are correctly send to clients and are fully replicated, no issue on that part.
But when replaying the replay, all these objects are null (and indeed the objects constructor never get called in replay)
Does replay need something special to be able to recreate these objects ? Maybe these objects needs to be added deterministically before the actor gets replicated (I would like to avoid that) ?
We could also do a NewObject<> client side for replay post replication if we can somehow “link” this object for replication
Note that we use Iris. The original container for the objects was a FastArray, but we have the same result when using a second TArray container
Thank you,
Anthony
Hi,
Just to double check, are these replays being recorded on the client or server? If they’re recorded on the client, are you adding these subobjects to the registered subobjects list on the client as well?
From this knowledge base article:
“While the server will certainly need to maintain these lists, actors/components on clients should also maintain their subobject list locally, particularly for any actors with local authority. This is especially important if a project is recording replays on clients, as actors on a client will temporarily be swapped to a local authority role when recording the actor into a replay. Because of this, any replay recorded actors should maintain their subobject list on the client, regardless of their local NetRole.”
Thanks,
Alex
Hello
The replay was recorded on the client. Indeed the AddReplicatedSubObject was only called server side.
When I added the AddReplicatedSubObject client side, when launching the replay I could see the objects being created.
However my references to these objects stayed NULL, so I used OnSubobjectCreatedFromReplication and the replication order to updates the pointers.
Thank you very much,
Anthony