File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
com.unity.netcode.gameobjects/Components Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -547,11 +547,12 @@ private void ResetInterpolatedStateToCurrentAuthoritativeState()
547
547
// NOTE ABOUT THIS CHANGE:
548
548
// !!! This will exclude any scale changes because we currently do not spawn network objects with scale !!!
549
549
// Regarding Scale: It will be the same scale as the default scale for the object being spawned.
550
- m_PositionXInterpolator . ResetTo ( transform . position . x , serverTime ) ;
551
- m_PositionYInterpolator . ResetTo ( transform . position . y , serverTime ) ;
552
- m_PositionZInterpolator . ResetTo ( transform . position . z , serverTime ) ;
553
-
554
- m_RotationInterpolator . ResetTo ( transform . rotation , serverTime ) ;
550
+ var position = InLocalSpace ? transform . localPosition : transform . position ;
551
+ m_PositionXInterpolator . ResetTo ( position . x , serverTime ) ;
552
+ m_PositionYInterpolator . ResetTo ( position . y , serverTime ) ;
553
+ m_PositionZInterpolator . ResetTo ( position . z , serverTime ) ;
554
+ var rotation = InLocalSpace ? transform . localRotation : transform . rotation ;
555
+ m_RotationInterpolator . ResetTo ( rotation , serverTime ) ;
555
556
556
557
// TODO: (Create Jira Ticket) Synchronize local scale during NetworkObject synchronization
557
558
// (We will probably want to byte pack TransformData to offset the 3 float addition)
You can’t perform that action at this time.
0 commit comments