Replicating Sublevels
Last updated
Was this helpful?
Last updated
Was this helpful?
Morpheus Actors in sublevels can be replicated by ensuring that the sublevel is loaded at both the Server and the Clients.
If you only loaded the sublevel at the server and forgot to do it at the client (or vice versa) the actors will not be replicated. This can be verified by checking if the MorpheusBeginPlay
event has been called on those actors.
You would also need to synchronize the state of the sublevels across your server and clients such that late joining clients would be able to restore the sublevel state (whether it's loaded or unloaded). Otherwise, the clients will be desynced on the state of those actors.
This synchronization can be done via a Replicated Sublevel Manager Singleton Morpheus Actor for example.
Unreal Engine 5 introduced that we support in Morpheus.
Use the Level Instancing workflow with one or more Actors to create Level Instances that can be placed down and repeated across your world.
Morpheus supports replication of actors on level instances placed in the level just like the Sublevels we discussed above.
As of v37, Morpheus supports replication of Morpheus Actors inside Level Instances that are loaded during runtime with some caveats.
When loading a level instance during runtime you need to ensure the following:
Both Server and Clients are loading the same instance at the same location, this can be done via a Replicated Level Instance Manager Singleton Morpheus Actor for example.
Both Server and Clients are using the same Optional Level Name Override
to load this level instance. This is because Morpheus links actors for replication via their PathName
and if this is different at the client than the server, the linking would fail and actors will be detached.
This can be done via the Unreal function Load Level Instance By Soft Object Ptr
below