https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnPlayerConnected.html
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Networking;
using UnityEngine;
public class SendData : MonoBehaviour {
void OnPlayerConnected (NetworkPlayer player) {
Debug.Log ("A player connected!");
}
}
This code, surprisingly, doesn't work!
Expected: The server prints "A player connected!" in the Unity editor debug console.
What happens: Nothing is printed. It doesn't matter if I use print() or Debug.Log().
This script is applied to a standard object in the scene. It has a NetworkIdentity.
I really don't know what else to try. The Unity documentation is very short and gives an example very similar to this. My code should be even simpler than Unity's example but it doesn't work.