Skip to content

Commit d5dfc63

Browse files
style
adding some needed comments
1 parent 861dbf1 commit d5dfc63

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,9 +1808,15 @@ private bool CheckForStateChange(ref NetworkTransformState networkState, ref Tra
18081808
if (InLocalSpace != networkState.InLocalSpace)
18091809
#endif
18101810
{
1811+
// When SwitchTransformSpaceWhenParented is set we automatically set our local space based on whether
1812+
// we are parented or not.
18111813
networkState.InLocalSpace = SwitchTransformSpaceWhenParented ? transform.parent != null : InLocalSpace;
18121814
isDirty = true;
1815+
// If SwitchTransformSpaceWhenParented is not set, then we will want to teleport
18131816
networkState.IsTeleportingNextFrame = !SwitchTransformSpaceWhenParented;
1817+
// Otherwise, if SwitchTransformSpaceWhenParented is set we force a full state update.
1818+
// If interpolation is enabled, then any non-authority instance will update any pending
1819+
// buffered values to the correct world or local space values.
18141820
forceState = SwitchTransformSpaceWhenParented;
18151821
}
18161822
#if COM_UNITY_MODULES_PHYSICS || COM_UNITY_MODULES_PHYSICS2D

0 commit comments

Comments
 (0)