LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

This version of Unity is unsupported.

MonoBehaviour.OnConnectedToServer()

Description

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

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnConnectedToServer() { Debug.Log("Connected to server"); // Send local player name to server ... } }