Basically, all I want to know is how can I get a client to send a variable to the server. Here is an example of what I tried in javascript:
var MyName : String = "Example Name";//Your username
var Player1Name : String = "";//How the server will store your username
function OnConnectedToServer(){
SendUserNameToServer();
}
@RPC
function SendUserNameToServer(){
if(Player1Name == "")
{
Player1Name = MyName;
}
}
Yes, I have attached a network view component to the gameobject holding this script. How can I get this to work properly? Thanks.