Skip to content

Commit 41ee413

Browse files
committed
Add more detail to logs and other small fixes
1 parent 76ef4b9 commit 41ee413

File tree

4 files changed

+80
-83
lines changed

4 files changed

+80
-83
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,14 +3719,9 @@ private void InternalInitialization(bool isOwnershipChange = false)
37193719
{
37203720
if (CanCommitToTransform)
37213721
{
3722-
if (NetworkObject.HasParentNetworkObject(transform))
3723-
{
3724-
InLocalSpace = true;
3725-
}
3726-
else
3727-
{
3728-
InLocalSpace = false;
3729-
}
3722+
// If our NetworkObject has a parent NetworkObject, then we are in netcode local space.
3723+
// GetComponentsInParent will get the networkObject on cachedNetworkObject as well, so we have a parent if we have more than one returned NetworkObject.
3724+
InLocalSpace = m_CachedNetworkObject.transform.GetComponentsInParent<NetworkObject>().Length > 1;
37303725
}
37313726

37323727
// Always apply this if SwitchTransformSpaceWhenParented is set.

0 commit comments

Comments
 (0)