- Home /
Question by
Bluestrike · Feb 18, 2014 at 06:16 PM ·
networkingcomponentrpc
Missing @RPC attribute error while it is there.
Hi I have the following error:
UnityEngine.NetworkView:RPC(String, RPCMode, Object[]) My function has @RPC before its declaration. I noticed the error says "Component" instead of the script name, when I remove @RPC in other scripts, the error lists the script name. What could be wrong here? function Awake() :void { networkView.RPC("SendMessage", RPCMode.Others);RPC call failed because the function 'SendMessage' in 'Component' does not have the RPC attribute. You need to add the RPC attribute in front of the function declaration
}
@RPC function SendMessage() :void { Debug.Log("test"); }
Comment
Best Answer
Answer by whydoidoit · Feb 18, 2014 at 06:18 PM
You cannot name you variable the same as an inbuilt function (SendMessage) - use a different name.