- Home /
Question by
legitplayer09 · Sep 28, 2016 at 03:24 PM ·
scripting problemmultiplayersynchronizationsync
How to Sync Spine Skins on UNet
I have atleast 4 skins for my Spine player Prefab. Each player gets to choose which skin do they want.
It Syncs with the host client, but for the other clients it does not.
Here is the code I used. Any help would be appreciated, Thanks!
[SyncVar]
public string skinname = "";
[Command]
void CmdSetSkin(string nameSkin){
skinname = nameSkin;
var skeletonRenderer = GetComponent<SkeletonRenderer> ();
skeletonRenderer.skeleton.SetSkin (skinname);
}
void Start () {
if (isLocalPlayer) {
CmdSetSkin(GameController.control.skinName);
}
Comment
Your answer
Follow this Question
Related Questions
Help| Sync' boolean variable (Friendly Fire) 0 Answers
[UNET] Unable to run [Command]s on remote client 1 Answer
Synchronizing multiplayer car game 1 Answer
How to synrchonize two floats from different scripts? 1 Answer
Photon Networking - What function(s) are called when a player (not me) is spawned? 2 Answers