diff --git a/Assets/Mirror/Runtime/NetworkBehaviour.cs b/Assets/Mirror/Runtime/NetworkBehaviour.cs index 9a002e9ee..f9f507990 100644 --- a/Assets/Mirror/Runtime/NetworkBehaviour.cs +++ b/Assets/Mirror/Runtime/NetworkBehaviour.cs @@ -34,17 +34,17 @@ public class NetworkBehaviour : MonoBehaviour protected readonly List syncObjects = new List(); // NetworkIdentity component caching for easier access - NetworkIdentity m_netIdentity; + NetworkIdentity netIdentityCache; public NetworkIdentity netIdentity { get { - m_netIdentity = m_netIdentity ?? GetComponent(); - if (m_netIdentity == null) + netIdentityCache = netIdentityCache ?? GetComponent(); + if (netIdentityCache == null) { Debug.LogError("There is no NetworkIdentity on " + name + ". Please add one."); } - return m_netIdentity; + return netIdentityCache; } }