- Home /
Question by
razvi02 · Sep 26, 2017 at 03:54 PM ·
networkingmultiplayernetworkstruct
how to sync a struct of numbers
Hey! I'm currently working on a multiplayer turn base strategy game and i kinda got stuck. I save the layout and the attributes (like hp) of all troops on a struct and i want to give that struct to all players so that they can update their world. the thing is i don't know how to sync a stuct. I saw a post about using unet messages but I have no idea on how they work.
This is the struct that needs to be synced.
public int unitcount;
public struct unitmanag
{
public int unitlayoutx;
public int unitlayouty;
public int hp;
public int dmg;
public int def;
public int unittype;
public int movepts;
public int maxhp;
};
public unitmanag[] unitmag = new unitmanag[10000];
Comment
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Can i make multiplayer game without unity multiplayer service ? 1 Answer
NetworkServer.dontListen not working - How do I stop clients connecting? 2 Answers
How can I get "!networkView.isMine" to function properly? 1 Answer
How To Deal With Lingering Prefabs in Multiplayer Scene ? 0 Answers