diff --git a/Assets/Mirage/Runtime/CustomAttributes.cs b/Assets/Mirage/Runtime/CustomAttributes.cs
index 58937d384f..c3942bc32b 100644
--- a/Assets/Mirage/Runtime/CustomAttributes.cs
+++ b/Assets/Mirage/Runtime/CustomAttributes.cs
@@ -114,6 +114,8 @@ public class ClientRpcAttribute : Attribute
public Channel channel = Channel.Reliable;
public RpcTarget target = RpcTarget.Observers;
public bool excludeOwner;
+ /// stops method being called on host/server
+ public bool excludeHost;
}
///
diff --git a/Assets/Mirage/Weaver/Processors/ClientRpcProcessor.cs b/Assets/Mirage/Weaver/Processors/ClientRpcProcessor.cs
index f53f6c4006..3af8bbcade 100644
--- a/Assets/Mirage/Weaver/Processors/ClientRpcProcessor.cs
+++ b/Assets/Mirage/Weaver/Processors/ClientRpcProcessor.cs
@@ -80,6 +80,7 @@ private MethodDefinition GenerateStub(MethodDefinition md, CustomAttribute clien
var target = clientRpcAttr.GetField(nameof(ClientRpcAttribute.target), RpcTarget.Observers);
var channel = clientRpcAttr.GetField(nameof(ClientRpcAttribute.channel), 0);
var excludeOwner = clientRpcAttr.GetField(nameof(ClientRpcAttribute.excludeOwner), false);
+ var excludeHost = clientRpcAttr.GetField(nameof(ClientRpcAttribute.excludeHost), false);
var rpc = SubstituteMethod(md);
@@ -89,7 +90,8 @@ private MethodDefinition GenerateStub(MethodDefinition md, CustomAttribute clien
// {
// call the body
// }
- CallBody(worker, rpc, target, excludeOwner);
+ if (!excludeHost)
+ CallBody(worker, rpc, target, excludeOwner);
// NetworkWriter writer = NetworkWriterPool.GetWriter()
var writer = md.AddLocal();