MonoBehaviour.OnConnectedToServer Manual     Reference     Scripting  
Scripting > Runtime Classes > MonoBehaviour
MonoBehaviour.OnConnectedToServer

function OnConnectedToServer () : void

Description

Called on the client when you have successfully connected to a server

JavaScript
function OnConnectedToServer() {
Debug.Log("Connected to server");
// Send local player name to server ...
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void OnConnectedToServer() {
Debug.Log("Connected to server");
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def OnConnectedToServer():
Debug.Log('Connected to server')