diff --git a/Gems/Multiplayer/Code/Source/Components/NetworkHierarchyRootComponent.cpp b/Gems/Multiplayer/Code/Source/Components/NetworkHierarchyRootComponent.cpp index 854aec521b..6858242cd4 100644 --- a/Gems/Multiplayer/Code/Source/Components/NetworkHierarchyRootComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Components/NetworkHierarchyRootComponent.cpp @@ -333,8 +333,9 @@ namespace Multiplayer const NetEntityId netRootId = GetNetworkEntityManager()->GetNetEntityIdById(m_rootEntity->GetId()); controller->SetHierarchyRoot(netRootId); - GetNetBindComponent()->SetOwningConnectionId(m_rootEntity->FindComponent()->GetOwningConnectionId()); } + + GetNetBindComponent()->SetOwningConnectionId(m_rootEntity->FindComponent()->GetOwningConnectionId()); } else { @@ -347,9 +348,10 @@ namespace Multiplayer NetworkHierarchyChildComponentController* controller = static_cast(GetController()); controller->SetHierarchyRoot(InvalidNetEntityId); - GetNetBindComponent()->SetOwningConnectionId(m_previousOwningConnectionId); } + GetNetBindComponent()->SetOwningConnectionId(m_previousOwningConnectionId); + // We lost the parent hierarchical entity, so as a root we need to re-build our own hierarchy. RebuildHierarchy(); }