diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index 52f6dbf77..cea92e2fc 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -730,9 +730,8 @@ internal void SetLocalPlayer() hasAuthority = true; } - for (int i = 0; i < m_NetworkBehaviours.Length; i++) + foreach (NetworkBehaviour comp in m_NetworkBehaviours) { - NetworkBehaviour comp = m_NetworkBehaviours[i]; comp.OnStartLocalPlayer(); if (localPlayerAuthority && !originAuthority)