@@ -94,8 +94,20 @@ public bool Deserialize(FastBufferReader reader, ref NetworkContext context, int
9494 }
9595 else
9696 {
97- Debug . LogError ( $ "[{ nameof ( NetworkTransformMessage ) } ][Invalid] Target NetworkObject does not exist!") ;
98- return false ;
97+ ownerAuthoritativeServerSide = networkManager . DAHost ;
98+ // If we are the DAHost and the NetworkObject is hidden from the host we still need to forward this message.
99+ if ( ownerAuthoritativeServerSide )
100+ {
101+ // We need to deserialize the state so we can send it to other connected clients (i.e. it will be re-serialized again).
102+ reader . ReadNetworkSerializableInPlace ( ref State ) ;
103+ // Fall through to act like a proxy for this message.
104+ }
105+ else
106+ {
107+ // Otherwise we can error out because we either shouldn't be receiving this message.
108+ Debug . LogError ( $ "[{ nameof ( NetworkTransformMessage ) } ][Invalid] Target NetworkObject ({ networkObjectId } ) does not exist!") ;
109+ return false ;
110+ }
99111 }
100112
101113 unsafe
@@ -119,12 +131,6 @@ public bool Deserialize(FastBufferReader reader, ref NetworkContext context, int
119131 ByteUnpacker . ReadValueBitPacked ( reader , out targetId ) ;
120132 targetIds [ i ] = targetId ;
121133 }
122-
123- if ( ! isSpawnedLocally )
124- {
125- // If we are the DAHost and the NetworkObject is hidden from the host we still need to forward this message
126- ownerAuthoritativeServerSide = networkManager . DAHost && ! isSpawnedLocally ;
127- }
128134 }
129135
130136 var ownerClientId = ( ulong ) 0 ;
@@ -173,7 +179,6 @@ public bool Deserialize(FastBufferReader reader, ref NetworkContext context, int
173179 {
174180 continue ;
175181 }
176-
177182 networkManager . MessageManager . SendMessage ( ref currentMessage , networkDelivery , clientId ) ;
178183 }
179184 // Dispose of the reader used for forwarding
0 commit comments