diff --git a/Assets/Mirror/Runtime/NetworkBehaviour.cs b/Assets/Mirror/Runtime/NetworkBehaviour.cs index 21a4a114c..9505deddd 100644 --- a/Assets/Mirror/Runtime/NetworkBehaviour.cs +++ b/Assets/Mirror/Runtime/NetworkBehaviour.cs @@ -60,12 +60,12 @@ public abstract class NetworkBehaviour : MonoBehaviour /// /// True if this object only exists on the server /// - public bool isServerOnly => isServer && !isClient; + public bool isServerOnly => netIdentity.isServerOnly; /// /// True if this object exists on a client that is not also acting as a server /// - public bool isClientOnly => isClient && !isServer; + public bool isClientOnly => netIdentity.isClientOnly; /// /// This returns true if this object is the authoritative version of the object in the distributed network application. diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index 59b9e83bc..a2ebe83da 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -162,6 +162,16 @@ public sealed class NetworkIdentity : MonoBehaviour /// public bool isLocalPlayer => ClientScene.localPlayer == this; + /// + /// True if this object only exists on the server + /// + public bool isServerOnly => isServer && !isClient; + + /// + /// True if this object exists on a client that is not also acting as a server + /// + public bool isClientOnly => isClient && !isServer; + /// /// This returns true if this object is the authoritative player object on the client. /// This value is determined at runtime. For most objects, authority is held by the server.