hi
i have a UI text in my scene and i want to change it, when clients type a word in their input text
and send the word as a simple string between other clients.
but when i testing it… it only send the world to the server and other clients text ui is not change !
what i have to do ?
here is my code :
[Client]
void ChatWriting ()
{
if (Input.GetKeyDown(KeyCode.Return))
{
CmdChat(ChatFieldText.GetComponent<Text>().text);
}
}
[Command]
public void CmdChat(string Cht)
{
ChatText.GetComponent<Text>().text = Cht;
}