Getting reference of Actor spawned by server on all clients

I am spawning replicated Actors through a Server RPC. Then, I need references to these Actors on every connected client to perform some local actions. Hence, I store the references to the spawned Actors in a temporary variable inside the function that spawns the Actors. The PlayerCharacters have a RepNotify Array where the references should be stored.

For testing purposes, I print the names of the referenced Actors in the OnRep_sceneActors function that is called on every client when the Array is updated by the server.

This generates the output shown below when the RPC is called from either Client (in this case, Client2) as in this case, two Actors of the type indicated by their handle were to be spawned. Notice that while I do get references on both Clients, the handles between Client1 and Client2/Server differ.
image

When I then want to access these references on Client1 at a later moment, the array is empty on that Client (and vice versa when the spawning was initiated from Client1). Where lies my misconception?

Thank you!

Potentially, this post could be relevant for anybody with a similar setup.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.