Hi, I’m trying to make a mobile multiplayer game in Unity Basic with Unity’s built-in networking. Are there any sample projects to download or any good tutorials? The problem is, that I would like the users to both host the server and play on the server on the same device. And I haven’t found any tutorials about that. And also the cheaper the better
any help how to make timer works and shows on server:
public Text myText;
public float mytime;
float myTimer;
[ClientRpc]
public void RpcDoOnClient(float foo)
{
mytime = foo;
myText.text = "" + mytime.ToString ();
}
[ServerCallback]
void Update()
{
myTimer+=Time.deltaTime;
// this will be invoked on all clients
RpcDoOnClient(myTimer);
}
This is the best reference I found for an updated solution. This guy practicaly defines an unofficial very detailed workflow on how to work with multiplayer games. If you need anything else there is this list of samples people pulled up some time ago.
Good Luck!
If you need fast and reliable network system, i suggest you to use DarkRift2. Complete articles are availaibe here