Working with UE5.3.2, I want to spawn multiple actors in a hierarchy (attached to each other) on a server.
In C++, I have a server function, that receives integers for the hierarchy and transforms for the spawn transforms for the actors. I tried using SpawnActor directly and SpawnActorDeferred with FinishSpawningActor.
When I use my setup without being connected to a dedicated server, the actors all spawn correctly at the correct place with the correct attachment order.
When I use the setup while being connected to a dedicated server, most actors are not at the correct position. In the level tree of the editor, the actors also seem to not be correctly attached. Progammatically, it looks like the attachment is actually correct (verifying using GetAttachedParentActor() and GetAttachedActors()).
To fix the spawn position, I also tried using a RepNotify FTransform variable for the actor, which I also set on the server. The actors on the clients use that FTransform for SetActorRelativeTransform().
Both SpawnActor and AttachToActor/AttachToComponent (with EAttachmentRule::KeepRelative) happen in the same server function directly after each other.
Thank you for your help.