- Home /
UNET RPG variable sync help
Hello I have unet working pretty well and just needed some help going in the right direction. My players have armor that is saved under variables and used to load, my only question is how would I have the variable and command be called only on a player but show up on all clients ?
This is a small example of how my code is set up. When an icon is dragged in an equipslot this command is called on the local player. So how do I have all clients see this change ?
Public int ehelm = 0;
Public void changehelm(int num){
//changes armor and variable
Ehelm = num
}
Answer by JavaMcGee · Sep 09, 2017 at 08:46 PM
I'm new to unet, but you might want to check out the docs for [SyncVar] (on your ehelm variable), and [Command] and [ClientRPC] annotation for the changehelm method. Sorry for short answer - typing on a phone...
Your answer
Follow this Question
Related Questions
I want to set play scene of network lobby manger through script 0 Answers
Spaw dynamic (unregistered) object on network (UNET) 0 Answers
how do you send commands from objects that dont have "Authortiy" unet 1 Answer
can't switching between weapons in multiplayer game? 0 Answers
Network Transport Layer API does not work with iOS to PC? 1 Answer