File tree Expand file tree Collapse file tree
com.unity.netcode.gameobjects/Runtime/Core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2172,6 +2172,10 @@ internal void InvokeSessionOwnerPromoted(bool isSessionOwner)
21722172
21732173 internal void InvokeBehaviourOnNetworkObjectParentChanged ( NetworkObject parentNetworkObject )
21742174 {
2175+ if ( ChildNetworkBehaviours == null )
2176+ {
2177+ InitializeChildNetworkBehaviours ( ) ;
2178+ }
21752179 foreach ( var child in ChildNetworkBehaviours . Values )
21762180 {
21772181 // Any NetworkBehaviour that is not spawned and the associated GameObject is disabled should be
@@ -2711,6 +2715,10 @@ internal void InternalInSceneNetworkObjectsSpawned()
27112715
27122716 internal void InvokeBehaviourNetworkDespawn ( )
27132717 {
2718+ if ( ChildNetworkBehaviours == null )
2719+ {
2720+ InitializeChildNetworkBehaviours ( ) ;
2721+ }
27142722 // Invoke OnNetworkPreDespawn on all child behaviours
27152723 foreach ( var childBehaviour in ChildNetworkBehaviours . Values )
27162724 {
You can’t perform that action at this time.
0 commit comments