- Home /
This question was
closed Aug 15, 2018 at 07:55 AM by
hexagonius for the following reason:
No problem description given
Question by
ProgrammerAdam12 · Aug 14, 2018 at 06:03 PM ·
c#networkingmultiplayer
[Command] Attribute Returning Warnings and Errors
Hi everyone, I've been trying for ages to get variables to sync between clients and servers. I have figured out how to use ClientRPC, but I'm stuck on [Command]. Here's the code: [Command] void Cmd_change_var2(int ammount){ GameObject.Find("Text").GetComponent<Text>().text = ammount.ToString(); hello = ammount; }
And here's a screenshot of my network manager. Thanks in advance for any response. Let me know if you need any other screenshots.
a.png
(65.8 kB)
Comment
How are you calling ClientRPC without first calling a Command? Also, does the object sending the command have local client authority? It needs to. What kind of errors / warnings are you recieving?