@@ -658,13 +658,7 @@ internal bool ApplyNetworkParenting()
658
658
659
659
if ( ! NetworkManager . SpawnManager . SpawnedObjects . ContainsKey ( m_LatestParent . Value ) )
660
660
{
661
- if ( OrphanChildren . Add ( this ) )
662
- {
663
- if ( NetworkLog . CurrentLogLevel <= LogLevel . Normal )
664
- {
665
- NetworkLog . LogWarning ( $ "{ nameof ( NetworkObject ) } ({ name } ) cannot find its parent, added to { nameof ( OrphanChildren ) } set") ;
666
- }
667
- }
661
+ OrphanChildren . Add ( this ) ;
668
662
return false ;
669
663
}
670
664
@@ -757,6 +751,27 @@ internal void MarkVariablesDirty()
757
751
}
758
752
}
759
753
754
+ // NGO currently guarantees that the client will receive spawn data for all objects in one network tick.
755
+ // Children may arrive before their parents; when they do they are stored in OrphanedChildren and then
756
+ // resolved when their parents arrived. Because we don't send a partial list of spawns (yet), something
757
+ // has gone wrong if by the end of an update we still have unresolved orphans
758
+ //
759
+
760
+ // if and when we have different systems for where it is expected that orphans survive across ticks,
761
+ // then this warning will remind us that we need to revamp the system because then we can no longer simply
762
+ // spawn the orphan without its parent (at least, not when its transform is set to local coords mode)
763
+ // - because then you’ll have children popping at the wrong location not having their parent’s global position to root them
764
+ // - and then they’ll pop to the correct location after they get the parent, and that would be not good
765
+ internal static void VerifyParentingStatus ( )
766
+ {
767
+ if ( NetworkLog . CurrentLogLevel <= LogLevel . Normal )
768
+ {
769
+ if ( OrphanChildren . Count > 0 )
770
+ {
771
+ NetworkLog . LogWarning ( $ "{ nameof ( NetworkObject ) } ({ OrphanChildren . Count } ) children not resolved to parents by the end of frame") ;
772
+ }
773
+ }
774
+ }
760
775
internal void SetNetworkVariableData ( FastBufferReader reader )
761
776
{
762
777
for ( int i = 0 ; i < ChildNetworkBehaviours . Count ; i ++ )
0 commit comments