From Unify Community Wiki
Revision as of 16:09, 5 July 2015 by Arun Mehta (Talk | contribs)

Jump to: navigation, search

We have an IRC channel dedicated to UNET! Join us on Freenode in the #unity3d-unet channel.



Tutorials (video)

Unity’s demo projects

Network starter is nice, also scroll a little down to find transport layer demo; also note the comment by Evil Otaku if you are having issues connecting with iOS, Android or WP8)

Other info

https://www.assetstore.unity3d.com/en/#!/content/40756 Unity 5 Survival Shooter (NOT UNET, but due to be updated)

Architecture ideas


Known issues & workarounds

Matchmaker working from the same pc but not working from a different pc

Example from http://docs.unity3d.com/Manual/UNetInternetServicesOverview.html does not work:

Occasionally required for online matchmaking

// This is your 5-digit project UNET ID at multiplayer.unity3d.com
// This is due to be fixed in an upcoming patch release (was not in 5.1.1p3)
void Awake() {
    PlayerPrefs.SetString( "CloudNetworkingId", "12345" );


// ClientRpc is called on the server - invokes on clients
public void RpcMyMethod( string msg ) {
	Debug.Log( "Got message from the server: " + msg  );

// Commands are called on clients - invokes on the server
// Note that you can only send commands if you own the object it calls from
public void CmdMyMethod( string msg ) {
	Debug.Log( "Got message from a client: " + msg );

// SyncVars are automatically sent from the server to other clients.
// Note that you still need a command to notify the server of the change
// if it comes from a client. Hook is optional
public string myString;
public void OnSomeoneChangedMyString( string myString ) {
	this.myString = myString;
	Debug.Log( "Changed myString to " + myString );

Simple script by Veoz (sometimes on #unity3d-unet at irc.freenode.net) for sending messages back and forth between 2 applications with using networking: http://hastebin.com/oxufizaxic.avrasm

Personal tools