O'Reilly logo

Unity Multiplayer Games by Alan Stagner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to Player.IO

The first thing we will do is connect to Player.IO. Note that connecting to Player.IO does not involve actually connecting to our development server. Essentially, our client connects to the Player.IO cloud service, and then joins a room in the chosen cluster.

Note

By default, Player.IO connects to the public cluster, but you can tell the client library to connect to the "development cluster" instead, which is your local server.

using UnityEngine; using System.Collections; using PlayerIOClient; public class ConnectToPlayerIO : MonoBehaviour { Client client; void Start() { PlayerIO.UnityInit( this ); // We connect to Player.IO here. Parameters are: // - The ID you copied earlier // - The connection type to use. "public" specifies ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required