@@ -453,9 +453,6 @@ internal NetworkVariable<NetworkTransformState> ReplicatedNetworkState
453453 // Used by integration test
454454 private NetworkTransformState m_LastSentState ;
455455
456- // Used by the non-authoritative side to handle ending extrapolation
457- private NetworkTransformState m_LastReceivedState ;
458-
459456 internal NetworkTransformState GetLastSentState ( )
460457 {
461458 return m_LastSentState ;
@@ -556,6 +553,8 @@ private void ResetInterpolatedStateToCurrentAuthoritativeState()
556553
557554 m_RotationInterpolator . ResetTo ( transform . rotation , serverTime ) ;
558555
556+ // TODO: (Create Jira Ticket) Synchronize local scale during NetworkObject synchronization
557+ // (We will probably want to byte pack TransformData to offset the 3 float addition)
559558 m_ScaleXInterpolator . ResetTo ( transform . localScale . x , serverTime ) ;
560559 m_ScaleYInterpolator . ResetTo ( transform . localScale . y , serverTime ) ;
561560 m_ScaleZInterpolator . ResetTo ( transform . localScale . z , serverTime ) ;
@@ -938,26 +937,6 @@ private void AddInterpolatedState(NetworkTransformState newState)
938937 }
939938 }
940939
941- /// <summary>
942- /// Stops extrapolating the <see cref="m_LastReceivedState"/>.
943- /// </summary>
944- /// <remarks>
945- /// <see cref="OnNetworkStateChanged"/>
946- /// </remarks>
947- private void TryToStopExtrapolatingLastState ( )
948- {
949- if ( ! m_LastReceivedState . IsDirty || m_LastReceivedState . EndExtrapolationTick >= NetworkManager . LocalTime . Tick )
950- {
951- return ;
952- }
953- // Offset by 1 tick duration
954- m_LastReceivedState . SentTime += m_TickFrequency ;
955- AddInterpolatedState ( m_LastReceivedState ) ;
956-
957- // Now reset our last received state so we won't apply this state again
958- m_LastReceivedState . ClearBitSetForNextTick ( ) ;
959- }
960-
961940 /// <summary>
962941 /// Only non-authoritative instances should invoke this method
963942 /// </summary>
@@ -976,21 +955,8 @@ private void OnNetworkStateChanged(NetworkTransformState oldState, NetworkTransf
976955
977956 if ( Interpolate )
978957 {
979- // This is "just in case" we receive a new state before the end
980- // of any currently applied and potentially extrapolating state.
981- // Attempts to stop extrapolating any previously applied state.
982- TryToStopExtrapolatingLastState ( ) ;
983-
984958 // Add measurements for the new state's deltas
985959 AddInterpolatedState ( newState ) ;
986-
987- // Set the last received state to the new state (will be used to stop extrapolating the new state on the next local tick)
988- m_LastReceivedState = newState ;
989-
990- // Set the current local tick and wait until the next tick before we end
991- // this state's potential of extrapolating past the target value beyond
992- // the state's relative tick duration
993- m_LastReceivedState . EndExtrapolationTick = NetworkManager . LocalTime . Tick ;
994960 }
995961 }
996962
@@ -1115,6 +1081,11 @@ private void Initialize()
11151081 // In case we are late joining
11161082 ResetInterpolatedStateToCurrentAuthoritativeState ( ) ;
11171083 }
1084+
1085+ if ( ! IsServer )
1086+ {
1087+ Interpolate = false ;
1088+ }
11181089 }
11191090
11201091 /// <summary>
@@ -1261,6 +1232,10 @@ protected virtual void Update()
12611232 {
12621233 return ;
12631234 }
1235+ if ( ! IsServer )
1236+ {
1237+ Interpolate = false ;
1238+ }
12641239
12651240 // If we are authority, update the authoritative state
12661241 if ( CanCommitToTransform )
@@ -1285,9 +1260,6 @@ protected virtual void Update()
12851260
12861261 // Apply the current authoritative state
12871262 ApplyAuthoritativeState ( ) ;
1288-
1289- // Attempts to stop extrapolating any previously applied state.
1290- TryToStopExtrapolatingLastState ( ) ;
12911263 }
12921264 }
12931265
0 commit comments