so this is one of many revisions here are the facts
the charactername string is being changed to the text that is nameingcharacter.text when i click the button
the string charactername is not sent to the server or synchronized with it.
even through calling the command i still cannot get the variable charactername to sync with the server
how would i edit to the script to ensure when the button calls a method that the variable charactername is sent to the server correctly?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
public class Name : NetworkBehaviour {
[SyncVar]
public string charactername;
public Text nameingcharacter;
public InputField entername;
public GameObject namer;
public void namecharacter(string Charactername)
{
charactername = nameingcharacter.text;
}
public void nameis()
{
namecharacter(charactername);
Cmd_charactername(charactername);
}
[Command]
void Cmd_charactername(string charactername)
{
namecharacter(charactername);
Rpc_namecharacter(charactername);
}
[ClientRpc]
void Rpc_namecharacter(string charactername)
{
namecharacter(charactername);
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}